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

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Fri Sep 15 13:19:10 CEST 2006


Peter Klein schrieb:

 > Object.prototype.objMerge = function(obj) {

This line adds objMerge to ALL objects, not just the ones created with 
objMerge.

 > (If the key isn't numeric, then it's an "Object", not an "Array")

No, I can do this:

x=new Array();
x['a']='b';
alert(x['a']);

JS Arrays work like PHP arrays. Both are a IMHO horrible mix between 
numeric and associative arrays. I guess that PHP borrowed this "feature" 
from JS.

Masi




More information about the TYPO3-dev mailing list