DEV Community

Takuya Kikuchi
Takuya Kikuchi

Posted on

Nested object and array destructuring

Destructuring on nested object? πŸ€”

Destructuring is commonly used, but do you know how to do destructuring nested object and array?

Can you refactor this?

Sandbox below to try it by yourself πŸ‘‡
Image 2021-08-15 at 12.35.10 PM

The code taken from MDN: Destructuring assignment - JavaScript | MDN

Use nested object and array destructuring πŸ‘

Image 2021-08-15 at 12.40.10 PM


Destructuring assignment - JavaScript | MDN


Discussion (0)