-
for arr.push(3)
length: 1, _capacity: 0, ptr: 0
-
for all pushes
length: 6, _capacity: 0, ptr: 15
Seems to show the length of the array as well as the total space allocated (ptr). The _capacity is unchanged as it was never used.
the ptr is the sum of the oldPtr and the array length
length: 3, _capacity: 0, ptr: 15
The array length decreased to 3 and values removed. The allocated space has stayed the same.
Its 0. After printing out the entire array it seems that very few values are something other than 0 and they don't seem to correspond to the values pushed in.
length: 1, _capacity: 0, ptr: 0 Looks like the array has one value but no allocated space? Not sure of the signifigance but if you muliply the org length and the new length, you get the ptr.
I'm not sure. From what I can see it is determining whether or not there is space available but beyond that I'm not certain. It seems to be clearing the oldPtr space but keeping a record of the oldPtr along with the current ptr and the current length in the copy method.