Javascript ES6 Array & Object Destructuring

ES6 introduced a number of significant improvements to the language, including de-structuring of Objects and Arrays.

Array Destructuring

Traditionally, to access elements in an Array, you would do so with their index number like so:

const array = [1, 2, 3];console.log(array[0])
// 1

--

--

--

Senior Software Developer at @thoughtworks | Marathon Runner | Ex-Pharmacist Writing on Coding, Technology and Running

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Link Your Lists

The Guide To Core Redux Concepts

Word every day: Easiest

Old Road Town For Loops and es6 forEach helper

Accepting Payments in a React Native App (Part 4)

Split an array into two equal Sum subarrays

Javascript Templating Language and Engine— Mustache.js with Node and Express

Downloading “undownloadable” web PDFs with Fiddler.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sherlynn Tan

Sherlynn Tan

Senior Software Developer at @thoughtworks | Marathon Runner | Ex-Pharmacist Writing on Coding, Technology and Running

More from Medium

padEnd() JavaScript

Regular Expression in JavaScript

JavaScript:- Arrays