This content originally appeared on DEV Community and was authored by ayan
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
This content originally appeared on DEV Community and was authored by ayan
ayan | Sciencx (2021-11-11T03:41:05+00:00) How to destructure arrays in Js?🤔. Retrieved from https://www.scien.cx/2021/11/11/how-to-destructure-arrays-in-js%f0%9f%a4%94/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.