JS: Array.prototype.unshift
arrayX.unshift(new1, new2, etc)
-
Adds items to the beginning of array arrayX. Return the new length.
// example of unshift const xx = [3]; const xy = xx.unshift(7, [8]); console.log(xy === 3); console.log(JSON.stringify(xx) === "[7,[8],3]");