You may have seen plenty of scripts in this forum or elsewhere workingwith arrays. Some of them use the push() function, other use concat() (see push API doc on w3school and concat API doc). The fundamental difference is that push modifies an existing array while concat() returns a new array.
An example:
var a = ["A", "B"];
a.push("C");
alert(a.join(",")); // this will give A,B,C
An example with concat
var a = ["A", "B"];
a.concat("C");
alert(a.join(",")); // this will give A,B
// correct usage:
bar b = a.concat("C");
alert(b.join(",")); // this will give A,B,C
So you can use concat in places you do not want to modify the original array and push if you want.
Another nice thing with both methods is that they accept multiple arguments and they accept arrays as well as single elements!
var a = ["A"];
a.push("B", "C", ["D"]);
alert(a.join(",")); // this will give A,B,C,D
Happy Scripting
Jan