how to add value in array in javascript?
I want to compare a number with a collection of numbers. So for it i want to know how we use use array 开发者_如何学Cin javascript and one thing more i want the syntax how to concatenate the values from a collection to this array. Thanks in advance
array.push(value); //adding value to the end of the array
var newArray = array.concat(oldArray); //concat array with oldArray
Check this w3schools tutorial, it explains what you asked and more:
JavaScript Array Object
精彩评论