r/javascript • • 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

31 comments sorted by

View all comments

12

u/mauvm Mar 24 '18

Why is this NSFW?

0

u/[deleted] Mar 24 '18

[deleted]

26

u/beb1312 Mar 24 '18

In my workplace its not uncommon to hear "fuck your mother" being directed toward a computer.

4

u/NotSelfAware Mar 25 '18

I once punched my monitor at work out of frustration, and it broke. It was old so they didn't care much. Pretty soon after we all went out for lunch.