JavaScript Reference/Javascript Methods/pop

Материал из Web эксперт
Перейти к: навигация, поиск

"pop()" Example

    
<html>
<body>
<button onclick="var myA = new Array(10,11,12); myA.pop(); alert(myA);">
Array pop method
</button>
</body>
</html>



"pop()" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |Array                                                         |
+----------------+--------------------------------------------------------------+



"pop()" Syntax, Parameters and Note

Note:
Removes the last element in an array. 
Returns the last element of the array.
    
Syntax:
    
arrayName.pop()