JS
ARRAY
DESTRUCTURING
Ajay Yadav
@ATechAjay
Destructuring
Ajay Yadav
@ATechAjay
Destructuring
Desctructuring means dividing an array
into multiple variables.
It is an ES6 syntax that allows us to unzip
or unpack an array of elements into multiple
variables.
Ajay Yadav
@ATechAjay
Assignment items
Assignment means storing the value of a
variable into another variable.
Ajay Yadav
@ATechAjay
Swapping items
Swapping means the value of two
variables are replaced to with each other.
Ajay Yadav
@ATechAjay
Escaping the items
If we want to get the first and last item in
an array, we can use the comma ( , ) as a
separator.
Ajay Yadav
@ATechAjay
Thanks for the reading
Follow me for ultimate content
on HTML, CSS, JavaScript,
React, DSA, and Git
Ajay Yadav
@ATechAjay