[thelist] Extending Javascript Objects

Matt Warden mwarden at gmail.com
Fri Aug 19 11:07:42 CDT 2005


> It's tempting to extend the Object prototype so that you'll have all
> these extra methods on all the objects derived from Object. But this
> is a *really* bad idea.
> 
> You see, doing so makes objects unusable as hashtables. Lets say that
> you've done this:

Actually, this is why you should never use Object as a hashtable. It
takes about 3 minutes to work around:

http://cvs.horde.org/co.php/incubator/Horde_Form/js/simplehashtable.js?r=1.1

-- 
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.


More information about the thelist mailing list