Panasonic Youth

Prototype and extending javascript's Object or Array

James McParlane wrote a entry detailing why he won’t use the Prototype library, as extending Object or Array’s builtin prototype is bad.

However, Sam heard the complaints about how Prototype 1.3.1 was breaking existing code and other libraries, and the newer relases all use Object.extend() for safe extensions and do not change Array’s prototype. Note that the prototype home page still only lists the old 1.3.1 version, which may be confusing some people. So either download just the .js file, or grab the latest Scriptaculous which has the 1.4 final also, and use the for…in without fear.