The one I recently flubbed was
unshift(), which seems silly but when you’re moving fast its an honest mistake to make!
Let’s review their MDN entries
How I always remember the difference:
If we literally break up the words into letters (similar to
split() lol) you might notice something:
The way I see it, unshift is “updating” our array above, “shift” with two additional characters in the front (“u” and “n”). In my mind I also remember this by matching up the “u” of update and “u” of unshift. Shift on the other hand complements this as its missing the “u. ” In fact this is even how
unshift() works! It prepends characters to the front of the array.
Hope this little trick helps you! Remember we update (think “u” ) with unshift… with two characters in the front of the word shift > unshift.