Web | This Site

JavaScript Basics
JavaScript Objects
JavaScript Advanced
JS Useful References
JS Useful Resources
Selected Reading
© 2011 TutorialsPoint.COM

| Home |  | References |  | Discussion Forums |  | About TP

# Javascript Array pop() Method

## Description:

Javascript array pop() method removes the last element from an array and returns that element.

## Syntax:

    array.pop();

Here is the detail of parameters:

- NA

## Return Value:

Returns the removed element from the array.

## Example:

    <html>
    <head>
    <title>JavaScript Array pop Method</title>
    </head>
    <body>
    <script type="text/javascript">
    var numbers = [1, 4, 9];

    var element = numbers.pop();
    document.write("element is : " + element );

    var element = numbers.pop();
    document.write("<br />element is : " + element );
    </script>
    </body>
    </html>

This will produce following result:

    element is : 9
    element is : 4

To understand it in better way you can Try it yourself.

Advertisement

Online Image Processing

Indian Baby Names