For example, normally if I have an array in another programming language,
I know that:
let arr = [1,2,3,4,5]
arr.push (1)
I can assume that the push is of order (n) because the memory of the array must be continuous. So in the worst case, the computer needs to copy the entire array to a new space where it can get continuous memory.
But this answer says that in javascript they are not continuous:
https://stackoverflow.com/questions/20321047/how-are-javascript-arrays-represented-in-physical-memory/20323491
"Worst case is the indexes are just hash keys, so the second array item at index 1 is located using hash key "1" in the object" So the arrays in javascript are actually hash dictionaries?