Wednesday, 9 April 2014

appending to an array...

I need to append to an array in order to convert the output from the XML exploration into an array that i can use.

from http://stackoverflow.com/questions/351409/appending-to-array

The commands are

// initialize array
var arr = [
    "Hi",
    "Hello",
    "Bonjour"
];

// append new value to the array
arr.push("Hola");

// display all values
for (var i = 0; i < arr.length; i++) {
    alert(arr[i]);
}

No comments:

Post a Comment