Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript array push

// JS array .push() method

let items_in_backpack = ['food', 'water', 'flashlight', 'GPS']; // Our starting array
items_in_backpack.push('javascript array push knowledge'); // Adds the <<< string to the array items_in_backpack


// Now the array is:
// ['food', 'water', 'flashlight', 'GPS', 'javascript array push knowledge']

Source by .www.developer.mozilla.com #
 
PREVIOUS NEXT
Tagged: #javascript #array #push
ADD COMMENT
Topic
Name
2+5 =