Lambda sayspush/pop work at the end; shift/unshift at the start — these mutate the array.
push adds to the end (returns new length), pop removes from the end (returns it). unshift/shift do the same at the front. All four mutate the array in place. End operations are fast; front operations re-index everything, so prefer push/pop in hot loops.
Power-ups you unlock
push/pop at the end · shift/unshift at the start
All four mutate in place
push/pop are faster (no re-indexing)
push returns length; pop/shift return the item
The Mutator attacks — common mistakes
Expecting these to return a new array (they mutate)
Heavy shift/unshift in loops (slow re-indexing)
Confusing what each returns
Boss battleUse a push/pop pair to treat an array as a stack.