“concat” does not join JavaScript arrays together?

前端 未结 2 2104
傲寒
傲寒 2020-12-11 02:17

I\'m running the following code on Webkit:

var scriptElements = document.scripts;
var scriptUrls = [];
// URL matching
var regexp = /\\b((?:[a-z][\\w-]+:(?:\         


        
2条回答
  •  执笔经年
    2020-12-11 02:56

    concat does not alter this or any of the arrays provided as arguments but instead returns a "one level deep" copy that contains copies of the same elements combined from the original arrays.

    https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/concat

提交回复
热议问题