How to remove last item to an array?

Bynayakdillip

How to remove last item to an array?

JavaScript Array Pop() Method

Pop(): it helps to remove last item(element) from an array and returns the final array.

Example:-

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

//remove last item using pop method
languageArray.pop();
alert(languageArray);

//it will print c#,c,java

About the author

nayakdillip administrator

Leave a Reply