Array in JavaScript has splice() method that changes the elements of an array, adding new elements as well as removing old.
splice() method for Array in JavaScript is powerful method that let you modify an existing array. You can add, remove elements or replace existing elements.