using the push method in javascript code example
Example 1: javascript push
const animals = ['pigs', 'goats', 'sheep'];
const count = animals.push('cows');
console.log(count);
console.log(animals);
animals.push('chickens', 'cats', 'dogs');
console.log(animals);
Example 2: how to push array
var numbers = [1, 2, 3, 4];
numbers.push(5);
var words = ["one", "two", "three", "four"];
words.push("five")
Example 3: how to append objects to javascript lists ?
var studentList = ['Jason', 'Samantha', 'Alice', 'Joseph'];
studentList.push('Jacob');