...

/

Array Destructuring: Extracting and Ignoring Values

Array Destructuring: Extracting and Ignoring Values

Get introduced to destructing and learn how array destructing is used to extract values.

Destructuring

Destructuring is an elegant way to extract data from arrays and objects. It removes the excessiveness and repetitiveness of using indexing operators or dots to get to the data within arrays and objects.

This notation takes a bit of getting used to, but soon you’ll be quite comfortable using it in your own code and also recognizing it in code you read.

Array destructuring

Functions typically return a single value: a primitive or an object. There is no elegant way to return multiple values other than returning an array. This makes the ...