Using shift/unshift for the stack would not be a very efficient solution when using JS arrays under the hood because that would turn an O(1) action into O(n) since every item in the array would have to update its index every time to perform either of these actions. Pushing onto the end or popping from it is O(1) since only a single item is affected.
One alternative to the stack example is to use shift/unshift.
A benefit is it covers adding and removing items, and allows you to treat the index of 0 as the top without worrying about it.
Also, not many people pay attention to those methods so you might even come across as clever for having non-obivous knowledge of JS Arrays.
Using shift/unshift for the stack would not be a very efficient solution when using JS arrays under the hood because that would turn an O(1) action into O(n) since every item in the array would have to update its index every time to perform either of these actions. Pushing onto the end or popping from it is O(1) since only a single item is affected.
Being able to talk about that makes a better interview.