append to js array code example
Example 1: javascript append to array
var colors=["red","white"];
colors.push("blue");
Example 2: javascript append array to array
const array1 = ['a', 'b', 'c'];
const array2 = ['d', 'e', 'f'];
const array3 = array1.concat(array2);
Example 3: javascript append element to array
var colors= ["red","blue"];
colors.push("yellow");
Example 4: add item to list javascript
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.push("Kiwi");
Example 5: js add element to array
var fruits = [ "Orange", "Apple", "Mango"];
fruits.push("Banana");
Example 6: c# append array
List<int> termsList = new List<int>();
for (int runs = 0; runs < 400; runs++)
{
termsList.Add(value);
}
int[] terms = termsList.ToArray();