ES3.1 Object static methods rationale document

Garrett Smith dhtmlkitchen at
Thu Jul 17 22:32:02 PDT 2008

On Thu, Jul 17, 2008 at 8:37 AM, John Resig <jresig at> wrote:
> I wanted to bring up some further evidence for the widespread use of an extend() method. Here are the top 5 JavaScript libraries and their associated versions of "Object.extend()":

> There are a couple points that are very important here:
> 1) They all extend the base object with the enumerable properties at least one other object.

Not true. YAHOO.lang.extend uses prototypal inheritance.

> 2) There is very little done to prevent properties coming in from [SomeObject].prototype - this is mostly because libraries opt not to use .hasOwnProperty() in favor of speed and/or cross-browser compatibility (older versions of Safari and IE Mac don't have hasOwnProperty).

Carelessness could be another reason. It is not hard to find bugs by
looking at the latest version of YAHOO.lang.extend, for example.


> --John

[snip top post]

More information about the Es4-discuss mailing list