JS: Array.prototype.unshift

By Xah Lee. Date: . Last updated: .
arrayX.unshift(new1, new2 etc)
Adds items to the beginning of array arrayX. Return the new length.
const ar = [3];
console.log ( ar.unshift(7, [8]) ); // 3
console.log ( ar ); // [7, [ 8 ], 3]

Buy JavaScript in Depth

JavaScript in Depth

JS Obj Ref

DOM


JS Obj Ref

Array

prototype