开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜