© 2026 Hashnode
unshift Add an element to the front of an array Array.prototype._unshift = function(...values) { const newArray = [...values, ...this] this.length = 0 this.push(...newArray) return this.length; }; const fruits = ['apple', 'mango', 'banana']...
