Javascript ES6+ Destructuring assignment
Destructuring assignment 배열의 해체할당 var colors = ['red', 'white', 'orange'] var first = colors[0] var second = colors[1] var third = colors[2] console.log(first, second, third) //결과: red white orange const colors = ['red', 'white', 'orange'] const [first, second, third] = colors console.log(first, second, third) //결과: red white orange 위의 두 코드의 결과는 똑같다. ES6+부터는 변수 이름을 배열화할 수 있게 되었다. const colors = ..
2020. 12. 14.