array-push refers to the javascript Array.prototype.push() method. The push() method adds one or more elements to the end of an array and returns the new length of the array.
array-push refers to the javascript Array.prototype.push()
method.
The
push()
method adds one or more elements to the end of an array and returns the new length of that array. developer
Example
var a = []; //or new Array()
var i = a.push('foo', 'bar');
console.log(i, a);
the console will display the values
2 ["foo", "bar"]
The counterpart to push()
is pop()
, which removes the last item from an array.