A Array.pop() (Method) Array.pop() (Method) Pops items (Remote web server)
A Array.pop() (Method) Array.pop() (Method) Pops items off of the end of an array like a FILO stack. Availability: ECMAScript edition 3 JavaScript 1.2 JScript 5.5 Internet Explorer 5.5 Netscape 4.0 Netscape Enterprise Server 3.0 Property/method value type: Depends on the array content JavaScript syntax: -myArray.pop() The pop() method returns the element at the end of the array. In doing so, it deletes the item from the end of the array reducing the array length by one. Elements are returned one at a time, even if several were pushed onto the stack together. Arrays that were pushed onto the stack are returned as arrays. Although this is very useful for programming stacks, it is not portable enough to deploy in a public facing site. The result of this method is the item that was on the end of the stack. Example code: // Create an array and test the Array.pop() method myArray = new Array(”AAA”, “BBB”, “CCC”); document.write(”Array
“) displayArrayAsTable(myArray); document.write(”Array.pop()
“) document.write(myArray.pop()) document.write(”
“) document.write(”Array after pop() call
“) displayArrayAsTable(myArray); // Display an array in a table function displayArrayAsTable(anArray) { myLength = anArray.length; document.write(”
| “); document.write(myIndex); document.write(” | “); document.write(anArray[myIndex]); document.write(” |
“) } See also: Array.prototype, Array.push(), Queue manipulation, Stack manipulation
Note: In case you are looking for affordable webhost to host and run your web application check Vision cheap hosting services