© Raju Gandhi 2019
Raju GandhiJavaScript Nexthttps://doi.org/10.1007/978-1-4842-5394-6_4

4. Divide and Conquer with Object and Array Destructuring

Raju Gandhi
(1)
Columbus, OH, USA
 
JavaScript lets us easily create “bags of data” using objects and arrays, permitting us the ability to fluidly wrap data and ship it around in our code. However, the syntax afforded to us to “reach” into these data structures tends to be verbose, imperative, and error-prone. In ES6 and ES9, JavaScript adopts yet another functional construct in the form of the destructuring syntax to improve our experience with unwrapping data, bringing it to parity with how we wrap data in the first place.
In this chapter we will see how the new destructuring syntax for both objects and ...

Get JavaScript Next: Your Complete Guide to the New Features Introduced in JavaScript, Starting from ES6 to ES9 now with O’Reilly online learning.

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