1. Push (Add to end of array to change original array)

Let temparr = [1, 2, 3, 4]; temparr.push(5) console.log(temparr) //[ 1, 2, 3, 4, 5 ]

2. Cancat (Do not change the original array. After concat merges arrays, the return value is the new array, and can merge two or more arrays.

Let temparr2 = temparr.concat([7,8]) console.log(temparr)//[1,2,3,4] console.log(temparr2)//[1,2,3,4, 7,8]

3. Merge an array by pushing the values of the latter array into the previous array, so that the previous array changes, and only merge between the two arrays.

Let arr1 = [1, 2, 3, 4]; let arr2 = ['a','b','c','d']; arr1.push.apply(arr1,arr2) console.log(arr1) //[ 1, 2, 3, 4, "a", "b", "c", "d" ]

4.ES6 extension operators… (Returns a new array)

Let arr1 = [1, 2, 3, 4]; let arr2 = ['a','b','c','d']; let arr3=[...arr1,...arr2] console.log(arr3) //[ 1, 2, 3, 4, "a", "b", "c", "d" ]