Array.push(...any) : number
// 向数组末尾插入元素,并返回数组的最新长度, push会修改原数组
Array.concat(...any) : Array
// 将any的值合并到数组中, 并返回新的数组, concat不会修改原始数组
let arr = ['a','b']
console.log(JSON.stringify(arr)) // ["a","b"]
let tmpArr = arr.push('c')
console.log(JSON.stringify(arr)) // ["a","b","c"]
console.log(JSON.stringify(tmpArr)) // 3
tmpArr = arr.concat('d')
console.log(JSON.stringify(arr)) // ["a","b","c"]
console.log(JSON.stringify(tmpArr)) // ["a","b","c"]
arr.push('hello','world')
console.log(JSON.stringify(arr)) // ["a","b","c","hello","world"]
arr.push(['good','idea'])
console.log(JSON.stringify(arr)) // ["a","b","c","hello","world",["good","idea"]]
tmpArr = arr.concat(['小花','张龙'])
console.log(JSON.stringify(tmpArr)) // ["a","b","c","hello","world",["good","idea"],"小花","张龙"]