> But String.fromCharCode is not inherited such that "hi".fromCharCode > delegates to String.fromCharCode. Hrm. > > I don't mean to single out String as a built-in. Whether user-defined or > built-in, today's constructor functions can have "class properties" that are > not inherited by instances. That seems like it could matter, e.g. to avoid > having Object.keys suddenly make keys properties appear in all objects -- > including in the global object!
Agreed. Ironically, having class methods also be instance methods makes things more Java-like, where all static methods can also be accessed via instances (albeit most IDEs give you a warning nowadays, but it’s legal in the language). -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com/rauschma home: rauschma.de blog: 2ality.com _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss