5DESTRUCTURING FOR EASIER DATA ACCESS

image

Object and array literals are two of the most frequently used notations in JavaScript, and thanks to the popular JSON data format, they have become a particularly important part of the language. It’s quite common to define objects and arrays, and then systematically pull out relevant pieces of information from those structures. ECMAScript 6 simplifies this task by adding destructuring, which is the process of breaking down a data structure into smaller parts. This chapter shows you how to harness destructuring for objects and arrays.

Why Is Destructuring Useful?

In ECMAScript 5 and earlier, the need to fetch ...

Get Understanding ECMAScript 6 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.