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

4. Divide and Conquer with Object and Array Destructuring

Raju Gandhi1 
(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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.