Spread
-
Destructuring, Spread, Rest parameters, Default parameters, Maps and ArraysDynamicPL/Javascript 2019. 10. 24. 19:28
1. Overview There are several new features added in ES6 which are Destructing, Spread, Rest, Default parameter, and so on. 2. Description 2.1 Destructing // ES5 var john = ['John', 26]; //var name = john[0]; //var age = john[1]; // ES6 // assign each element to variable const [name, age] = ['John', 26]; console.log(name); console.log(age); const obj = { firstName: 'John', lastName: 'Smith' }; co..