Open meeyoungchoi-front-dev opened 6 months ago
`var arr = [1, 2];
arr.unshift(0); // result of call is 3, the new array length // arr is [0, 1, 2]
arr.unshift(-2, -1); // = 5 // arr is [-2, -1, 0, 1, 2]
arr.unshift([-3]); // arr is [[-3], -2, -1, 0, 1, 2]`
unshift() : 새로운 요소를 배열의 맨 앞쪽에 추가하고 추가된 새로운 배열을 반환한다
`var arr = [1, 2];
arr.unshift(0); // result of call is 3, the new array length // arr is [0, 1, 2]
arr.unshift(-2, -1); // = 5 // arr is [-2, -1, 0, 1, 2]
arr.unshift([-3]); // arr is [[-3], -2, -1, 0, 1, 2]`