Array Power, Part II - DHTML Lab | 3
Array Power, Part II
|the push() method returns the last element added to an array||the push() method returns the new length of the array.|
|lastElement = ||arrayLength = |
We'll simplify things. We'll need to assume the following:
To achieve the above, we need not to browser-sniff or script-sniff, but to array-sniff! We'll need to identify what behavior the browser supports for push(). If it is the old behavior, then we can redefine push() using prototyping.
Produced by Peter Belesis andAll Rights Reserved. Legal Notices.
Created: May 2, 2000
Revised: May 2, 2000