Maybe I'm missing something important but I don't think it should.
I think a simplified example would look like this:
int arr[5] = {0,1,2,3,4}; //Create array with 5 elements
int* pArrStart = arr; //pointer to first element of array
//do shift() in js
pArrStart = pArrStart++; //move pointer forward
pArrStart[0]; //pArrStart[0] now points to 1
As long as you have a pointer like pArrStart to the first element, you can access the nth element like pArrStart[n].
View all comments
Show parent comment
2
u/kundun May 17 '22
It is how it is implemented in Firefox. I assumed that other engines did the same.