r/javascript • u/freebit • Mar 24 '18
Can't keep Array.shift vs Array.unshift straight? (NSFW) NSFW
Here is a helpful, although gross mnemonic to help keep the two straight in your head. Drop the "f".
So, Array.shit() drops a load (element) from the beginning of an array and Array.unshit() will do the opposite.
69
Upvotes
12
u/mauvm Mar 24 '18
Why is this NSFW?