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
- Mozila Firefox 1.0
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.