How to destructure arrays in Js?🤔
source link: https://dev.to/anuppal48672810/how-to-destructure-arrays-in-js-410e
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Posted on Nov 11
How to destructure arrays in Js?🤔
Hi today I am going to show you how to destructure an array in JavaScript.
Let's take an object.
This is how we retrieve the values of arrays normally in a very simple way.
But can do the same in a line using array destructuring.
Now taking we can use the values of restaurant using array destructuring.
Suppose we want to take categories . We can do it like this.
Suppose we don't want all the values in category
then
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK