title: Time complexity of unshift() vs. push() in Javascript
body: <p>I know what is the difference between <code>unshift()</code> and <code>push()</code> methods in JavaScript, but I'm wondering what is the difference in time complexity?</p>
  
  <p>I suppose for <code>push()</code> method is O(1) because you're just adding an item to the end of array, but I'm not sure for <code>unshift()</code> method, because, I suppose you must "move" all the other existing elements forward and I suppose that is O(log n) or O(n)?</p>