JavaScript Array unshift() Method
The JavaScript Array.prototype.unshift() method adds one or more elements to the beginning of an array and returns the new length of the array. This method modifies the original array and is useful when you need to prepend elements to an existing array. Syntax Parameters Parameters Description element1, element2, /* …, */ elementN The elements to…