Hey! Great refresher as the others say! Is one faster or preferred than another? I'm slowly trying to understand best-best practices, started learning about memory leaks etc, and it's a whole new world. WeakSets, WeakMaps, Proxies, etc (Of course, I have to thank you about Proxies, your video was the only one I was comfortable with)
Some of these array methods mutate the original array. Every time you mutate an array, a puppy dies. Please think of the puppies! Chrome has implemented some of the new array methods that are alternatives to splice, reverse, and sort. The new methods are called toReversed, toSpliced, and toSorted.
Thank you for a fresh reminder
Well a great refresher
00:00 - array.push()
1:25 - array.unshift()
2:16 - array.splice()
4:18 - array.concat()
5:54 - spread syntax
bruh, thx
Thanks Dom, solid vid as always.
The last method, you dont need to use spread operator again to insert it
const moreDevices = [...devices, "Mobile Phone", "Tablet"];
Hey! Great refresher as the others say! Is one faster or preferred than another? I'm slowly trying to understand best-best practices, started learning about memory leaks etc, and it's a whole new world. WeakSets, WeakMaps, Proxies, etc (Of course, I have to thank you about Proxies, your video was the only one I was comfortable with)
Note that the last one creates a NEW array, it doesn't change the old one, you still have access to the old one.
Some of these array methods mutate the original array. Every time you mutate an array, a puppy dies. Please think of the puppies! Chrome has implemented some of the new array methods that are alternatives to splice, reverse, and sort. The new methods are called toReversed, toSpliced, and toSorted.
Johnny be good