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]

12

u/[deleted] Mar 24 '18 edited Mar 24 '18

the word "shit" is generally not acceptable in the workplace here in the United States.

If you think that's really the case, then maybe you work with a bunch of puritans.

This post may be 'nsfw' entirely because there are minors interested in javascript.

No adult I know in any place I've worked would be offended by the word "shit".