push() function: The array push() function adds one or more values to the end of the array and returns the new length. This method changes the length of the array. But here we will use this function to push the whole array into an object.
arr.push(element1[, ...[, elementN]])
An array can be inserted into the object with push() function, below examples illustrate the above approach:
Supported Browsers: The supported browser by the Array Push() Function are listed below:
- Google Chrome 1.0
- Internet Explorer 5.5
- Mozilla Firefox 1.0