js how to add data to array code example
Example 1: js add element to array
var fruits = [ "Orange", "Apple", "Mango"];
fruits.push("Banana");
Example 2: js array push
const arr = ["foo", "bar"];
arr.push('baz'); // 3
arr; // ["foo", "bar", "baz"]