hpw tp create a function to add data to an array code example
Example 1: js add element to array
var fruits = [ "Orange", "Apple", "Mango"];
fruits.push("Banana");
Example 2: how to add to an array
var ar = ['one', 'two', 'three'];
ar[3] = 'four'; // add new element to ar