늘 겸손하게

JavaScript - '...'연산자 ( spread operator ) 본문

Programming/JavaScript

JavaScript - '...'연산자 ( spread operator )

besforyou999 2022. 7. 12. 13:58

spread operator는 배열의 원소를 나열하는 연산자입니다

 

const arr1 = [1,2,3];
const arr2 = [4,5,6];

console.log(...arr1); //1 2 3
console.log(...arr2); //4 5 6