Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Array Destructuring

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

const [red, yellow, green] = foo;
console.log(red); // "one"
console.log(yellow); // "two"
console.log(green); // "three"
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #Array #Destructuring
ADD COMMENT
Topic
Name
2+8 =