How to append item to an array?

Bynayakdillip

How to append item to an array?

JavaScript Array push() Method

Push():-Its helps to add a new item at the end of the array.use the push() method/function to append an array

Example:-

//Array of programing language
var languageArray=['c#','c','java'];
//its diplay like c#,c,java
alert(languageArray);

//Append new value to the array

languageArray.push('salesforce');

alert(languageArray);

//it will print c,c#,java,Salesforce

Note: You also push object type in an array its depend upon your requirement.

About the author

nayakdillip administrator

Leave a Reply