Arrayunshift
Arrayunshift is a JavaScript array method that adds one or more elements to the beginning of an array. It modifies the original array and returns the new length of the array.
The syntax for arrayunshift is array.unshift(element1, element2, ..., elementN). The elements can be of any data type.
For example, if you have an array `myArray = [2, 3, 4]` and you call `myArray.unshift(1)`, the array
Arrayunshift is often contrasted with arraypush, which adds elements to the end of an array. Unlike some
The performance of arrayunshift can vary depending on the JavaScript engine and the number of elements being