题解 | #添加元素#
添加元素
http://www.nowcoder.com/practice/941bcfa5b87940869fda681c1597fd3a
{"css":"","js":"function insert(arr, item, index) {\n return arr.slice(0,index).concat([item]).concat(arr.slice(index));\n}","html":"","libs":[]}
不提倡这样,但是真爽
添加元素
http://www.nowcoder.com/practice/941bcfa5b87940869fda681c1597fd3a
{"css":"","js":"function insert(arr, item, index) {\n return arr.slice(0,index).concat([item]).concat(arr.slice(index));\n}","html":"","libs":[]}
不提倡这样,但是真爽
相关推荐