push item to array js

JavaScript
var colors=["red","white"];
colors.push("blue");//append 'blue' to colorsarray = ["hello"]
array.push("world");

console.log(array);
//output =>
["hello", "world"]const arr = ["foo", "bar"];
arr.push('baz'); // 3
arr; // ["foo", "bar", "baz"]
Source

Also in JavaScript: