I am having hard time remembering what Array.shift()
and Array.unshift()
do.
After few years, I still have too check out reference from time to time when I need to use one of them. Can anyone explain why those names are choosen and how to memorize which one does what?
I have no such problem with Array.push()
and Array.pop()
shift
removes elements andunshift
adds them :)