|
|
|
|
|
by cwdegidio
1025 days ago
|
|
It makes sense. It is an array. When you remove the first element, all elements in the array have to shift to their new indices "left" (one less than their previous index). When you unshift, all elements must move their indices up by 1, to the "right". In theory it is staying at the same memory address (unless unshifting causes the array to double in size to account for further growth... then it will be given a new memory address). |
|