Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js Destructuring arrays and objects

// 1) Destructure array items
const [first, second,, fourth] = [10, 20, 30, 40];

// 2) Destructure object properties
const { PI, E, SQRT2 } = Math;
Source by jscomplete.com #
 
PREVIOUS NEXT
Tagged: #js #Destructuring #arrays #objects
ADD COMMENT
Topic
Name
1+2 =