let books = ['1', '2', '3'];
let books1 = ['4', '5'];
let book2 = ['6', '7']
let allbooks = books1.concat(books, book2)
let allbooks1 = [...allbooks,...book2]
// 将数组里面的值显示出来(es6写法...)
console.log(...allbooks,...book2)
console.log(allbooks1)
打印结果:4 5 1 2 3 6 7 6 7
[ '4', '5', '1', '2', '3', '6', '7', '6', '7' ]
注意:有顺序之分
网友评论