1

How to destructure arrays in Js?🤔

 2 years ago
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.
neoserver,ios ssh client
ayan

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


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK