JavaScript Mnemotechnics

Useful tips to remember evil twins distinct behaviors.

Array prototype methods

slice vs splice

splice mutates the original object by optionally putting new elements inside it.

shift vs unshift

unshift works like push.

Function prototype methods

apply vs call

apply takes an array as second paramater.

String prototype methods

substr vs substring vs slice