Array Push

Array Push

var typesOfFruit = ['Apple','Orange','Peach','Pear','Pineapple','Bunch of Grapes','Banana'];
typesOfFruit.push('Guava');
// the end result is that the array would contain
// ['Apple','Orange','Peach','Pear','Pineapple','Bunch of Grapes','Banana','Guava']
Comments are closed.