JavaScript Objects The Array Object- push() - Javascript Objects

What is JavaScript - Array push() Method?

Javascript array push() method appends the given element(s) in the last of the array and returns the length of the new array.

Syntax

Its syntax is as follows −

Parameter Details

element1, ..., elementN: The elements to add to the end of the array.

Return Value

Returns the length of the new array.

Example

Try the following example.

Output

new numbers is : 1,4,9,10

new numbers is : 1,4,9,10,20


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Javascript Objects Topics