Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript Array Destructuring

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

// destructuring assignment in arrays
const [x, y, z] = arrValue;

console.log(x); // one
console.log(y); // two
console.log(z); // three
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript #Array #Destructuring
ADD COMMENT
Topic
Name
3+2 =