When working with Javascript arrays, splice() is an invaluable function that helps conveniently add/remove elements to them. The definition of splice() looks like this: