Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Add an item to the beginning of an Array

let newLength = fruits.unshift('Strawberry') // add to the front
// ["Strawberry", "Banana"]
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #Add #item #beginning #Array
ADD COMMENT
Topic
Name
5+1 =