[TYPO3-dev] WARNING: Is Prototype affecting the inbuilt JavaScript Array and Object types?

Martin Kutschker martin.kutschker-n0spam at no5pam-blackbox.net
Fri Sep 15 17:07:08 CEST 2006


Peter Klein schrieb:
> "Martin Kutschker" <Martin.Kutschker at n0spam-blackbox.net> skrev i en 
> 
> Yes, but x['a']='b' is not part of the array, but instead a property of "x" 
> (as an Array is also an Object).
> That's why length only returns a value of 2 and not 3. (as length is only 
> available for Arrays.)

Originally I thought the length would change, but the link made it clear 
why it wouldn't.

> So when you access it like "alert(x['a'])", you are accessing it as an 
> Object, and reads "x" 's properties (in this case, the "a" property).

I understood. I was just pointing out that just because I make use of 
the Object properties and methods I do not change the class. The Array 
is still an Array.

Masi





More information about the TYPO3-dev mailing list