JavaScript ES6 - Destructuring

preview_player
Показать описание
Our first ES6 video walks through both object and array destructuring.
Рекомендации по теме
Комментарии
Автор

this video made me understand destructuring.

omegamon
Автор

Cool so it's just like python's tuple thingy
numbers = 1, 2, 3, 4, 5
a, b, c, d, e = numbers
Only python makes it look nicer. :p

FlashManinSpace
Автор

what about extracting a single property from the object using destructor?? is there any way or any particular element like we can do in term of array or object that has lot of items or properties (ex: obj[i] or obj.propName)

shahadathossain
Автор

use jsfidller or another online js editor so as to see directly the console output

georgesmith
Автор

^z to suspend vim; do whatever at shell; fg to resume suspended job #protip

uzaarnaam
Автор

const things = ['red', 'basketball', 'paperclip', 'green', 'computer', 'earth', 'blue', 'dogs'];
const one = ' ';
const two = ' ';
const three = ' ';

How can I assign the colors 'red', 'green' & 'blue' from things array,
to the constants one, two & three using destructuring?

khansameerahmed