JavaScript: The Definitive Guide, Sixth Editio javaScript权威指南(第6版) pdf 文字版-文字版, javascript电子书, 和javascript 有关的电子书:

7.8.4 concat()

}); // => ['ant','Bug','cat','Dog']


7.8.4 concat()

The Array.concat()method creates and returns a new array that contains the elements of the original array on which concat()was invoked, followed by each of the arguments to concat(). If any of these arguments is itself an array, then it is the array elements that are concatenated, not the array itself. Note, however, that concat()does not recursively flatten arrays of arrays. concat()does not modify the array on which it is invoked. Here are some examples:

var a = [1,2,3]; a.concat(4, 5) // Returns [1,2,3,4,5] a.concat([4,5]); // Returns [1,2,3,4,5] a.concat([4,5],[6,7]) // Returns [1,2,3,4,5,6,7] a.concat(4, [5,[6,7]]) // Returns [1,2,3,4,5,[6,7]]

欢迎转载,转载请注明来自一手册:http://yishouce.com/book/1/31350.html
友情链接It题库(ittiku.com)| 版权归yishouce.com所有| 友链等可联系 admin#yishouce.com|粤ICP备16001685号-1