JavaScript Reference/Javascript Methods/pop

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

"pop()" Example

   <source lang="javascript">
   

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


     </source>
   
  


"pop()" is applied to

   <source lang="javascript">

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

     </source>
   
  


"pop()" Syntax, Parameters and Note

   <source lang="javascript">

Note: Removes the last element in an array. Returns the last element of the array.

Syntax:

arrayName.pop()


     </source>