Data Structures in Javascript - Arrays (Coding array from scratch)

preview_player
Показать описание
Alright, last video was an overview of the array data structure. Pretty boring, but, whatever. So, in this one, we'll actually code out an array to increase our understanding. Keep going.

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

When using the 'delete' key word in the pop() method, it deletes that entire index, that is why shiftIndex doesn't work. If you reassign the index you are deleting (instead of delete) then it works and the indexes will shift. Keep the 'delete' for the last element in the array, that is the only one you need. This was driving me nuts for the last 90 minutes.

In general, thank you for the content Adam!!

unachoza
Автор

At 8:55, notice how your console.log shows you deleted the element but you didn't change anything about the indexes. It doesn't work properly.

sirbalafort
Автор

I think your shiftIndex(index) its not working properly. Its not shifting the indexes. It's really just decrementing the this.length

marcocoronado
join shbcf.ru