Here is the sample code which destructures an array and object. Reference code:
For arrays we can give any name we want, but while destructuring objects we can give only object property names.
![](https://smartcodehelper.com/wp-content/uploads/2021/04/image-13.png)
Alternate option for destructuring objects:
Here is the sample code which destructures an array and object. Reference code:
For arrays we can give any name we want, but while destructuring objects we can give only object property names.
Alternate option for destructuring objects: