Array Power, Part II - DHTML Lab | 8 | WebReference

Array Power, Part II - DHTML Lab | 8

Logo

Array Power, Part II
pop() demo


In this example, we start with an array composed of elements of various types.

Click the pop( ) button, to remove an element from the array.

The statement generated to remove the last element is displayed in the Statement field.

The contents of the array before the pop() method is used appears in the Old myArray field.

The current contents of the array, after pop(), are displayed in the New myArray field.

The Type field is for reference only, demonstrating that the type of object returned from the method is respected.

Old myArray: (before pop())
New myArray: (after pop())
finalGuy: Type:
Statement: finalGuy = myArray.pop()




Now, let's wrap up.


Produced by Peter Belesis and

All Rights Reserved. Legal Notices.
Created: May 2, 2000
Revised: May 2, 2000

URL: http://www.webreference.com/dhtml/column32/8.html