Unshift in Javascript

For a very long time now, I had been under the understanding that since Javascript arrays were just a kind of object, that array.unshift() wasn’t any more costly that array.push().

Today I finally did some testing and found out that I was very much wrong. Now you know and won’t experience the same performance issues that I ran into.

Leave a Reply