Courses / JavaScript
12. Array.prototype.unshift()
Adds one or more elements to the beginning of an array and returns the new length of the array.
1 min read Chapter 12 of 99
JavaScript
Array.prototype.unshift()
`unshift()` adds elements to the start of an array.
"I need to add new items to the front of my list without losing the existing ones."
`Array.prototype.unshift()` modifies an array by adding one or more elements to the beginning and returns the new length of the array.
"I need to add new items to the front of my list without losing the existing ones."
`Array.prototype.unshift()` modifies an array by adding one or more elements to the beginning and returns the new length of the array.