Browse - Programming Tips - How do I append to the end of a javaScript array?

Date: 2010nov11
Language: javaScript
Level: beginner

Q.  How do I append to the end of a javaScript array?

A.  Use push() like this:

var a = new Array(); // Create an array a.push('apple'); // append a.push('pear'); // append