开发者

how to add value in array in javascript?

开发者 https://www.devze.com 2023-04-05 14:05 出处:网络
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 fr

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

精彩评论

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