Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

destructuring

var foo = ['one', 'two', 'three'];

// without destructuring
var one   = foo[0];
var two   = foo[1];
var three = foo[2];

// with destructuring
var [one, two, three] = foo;
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #destructuring
ADD COMMENT
Topic
Name
9+7 =