how to push array into array in javascript code example
Example 1: javascript pushing to an array
some_array = ["John", "Sally"];
some_array.push("Mike");
console.log(some_array);
["John", "Sally", "Mike"]
Example 2: add array to array javascript
const list1 = ["pepe", "luis", "rua"];
const list2 = ["rojo", "verde", "azul"];
const newList = [...list1, ...list2];
Example 3: javascript array push
var fruits = [ "Orange", "Apple", "Mango"];
fruits.push("Banana");
Example 4: javascript append to array
arr = [1, 2, 3, 4]
arr.push(5)
arr.unshift(0)
Example 5: js push
let arr = [9, 4, 3, 18]
arr.push(30)
console.log(arr)
Example 6: push javascript
let twentyThree = 'XXIII';
let romanNumerals = ['XXI', 'XXII'];
romanNumerals.push(twentyThree);
romanNumerals.unshift('XIX', 'XX');