Now let’s see a very basic example where we will be pushing a data point into an Array
Array of Number
// Simple Example to push numbers and strings into an Array
var Numbers = [1,2,3,4,56];
Array of String
var Strings = ['Car','Bus','Truck','Rocket']
Now let us insert some JSON data into a JSON Array.
Push into JSON Array
var student = [
Merging Arrays using Push using apply()
If the length of the Second Array is not too large then you can go ahead and use apply() method in order to merge two arrays.
// Merging Two Arrays into One
var People1 = ['Zen','Ken','Den'];
var People2 = ['Yen','Brat'];
// Merging the first Array into the Second
You can find all these running together out here below. Have a look at the code for each.
Also published on Medium.