JavaScript splice, slice, shift, pop

Posted by Joe Enos on April 28, 2021 · 1 min read

These four functions are commonly used to copy or modify arrays in JavaScript. I generally have the signatures printed as a cheat sheet since I can never keep them all straight.

View code on GitHub