Time complexity of unshift() vs. push() in Javascript Time complexity of unshift() vs. push() in Javascript arrays arrays