how to add to a list in javascript code example

Example 1: append array js

var colors= ["red","blue"];
	colors.push("yellow"); //["red","blue","yellow"]

Example 2: javascript append element to array

var colors= ["red","blue"];
	colors.push("yellow");

Example 3: add item to list javascript

var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.push("Kiwi"); // Fruits = ["Banana", "Orange", "Apple", "Mango", "Kiwi"];

Example 4: js add item to array

var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.push("Kiwi");

Example 5: pushing to an array

array = ["hello"]
array.push("world");

console.log(array);
//output =>
["hello", "world"]

Example 6: how to add list in javascript

print(list)