Array Slice vs. Splice in JavaScript: A HUGE DIFFERENCE

preview_player
Показать описание
Let's take a look at the differences between two very similarly named methods in JavaScript: Array Slice and Array Splice.

For your reference, check this out:

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

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

Thank you for the video. I was unaware that you could use splice with just the index to remove items like that. So using index -1 is an easy way to remove the last item of an array then. Handy information.

williammckeever
Автор

Hi Dom,
Another nice one. Thanks for sharing.
But generally speaking you should keep it as simple as possible for data which you control. If the data you use is is external (outside of you control) you might need these fancy tricks.

montebont
Автор

This is great stuff, I just subscribed and will be bingeing your videos

interestedinbread
Автор

DOM this is well understood.👍👍👍can you explain to us difference between map, for each, filter and sort . We will appreciate it sir. Thank you 🇬🇭🇬🇭🇬🇭

isaacadigbli