Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

destructuring assignment

Destructuring assignment is special syntax introduced in ES6, 
for neatly assigning values taken directly from an object.

const user = { name: 'John Doe', age: 34 };

const { name, age } = user;
// name = 'John Doe', age = 34
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #destructuring #assignment
ADD COMMENT
Topic
Name
4+5 =