Using Destructuring with Array Shuffle Example

preview_player
Показать описание
I had a question about one of my tutorials that I did a few years back on shuffling an array. As I was looking at the code, I could see it could be improved with destructuring. In this tutorial I show that improvement because it really is a nice application of destructuring.

Would you like to help keep this channel going?

Tutorials referred to in this video:

For more resources on JavaScript:

#javascript #AllThingsJavaScriptLLC
Рекомендации по теме
Комментарии
Автор

Great to see another excellent video from what I consider to be the best JavaScript teacher there is. Thank you Steven!

TillmanTech
Автор

Do major Javascript engines treat two cases same?
I was thinking if there is any significant performance difference between two.
Very clean solution though, thank you!

johnswanson
Автор

Hi, I love your tutorials. I didn't watch you previews tutorial about shuffling the array but in this tutorial, you are looping through the array backward. I got little confused and ran the code myself and find out you are looping 8 times but there are 9 elements in the array so when it checks (is 0 > 0 ) it fails and loops stops. Can we also do that ( i >=0 ) to loop over all the elements? Thank you.

ahmedabbas