On Sat, 15 Jan 2011 04:15:52 +0100, Joel Dart <[email protected]> wrote:
Number constructor has to exist to give access to the prototype which I
agree isn't as useful in itself. However, augmenting Array has several
interesting uses. The more I think about it, the more I see that the
constructors and access to prototypes for the primitives helps maintain
consistency across the language.
The Number.prototype object could easily be somewhere else, and Number
could
just be a converter, not a constructor.
The primitive type wrappers (Number, String, and Boolean *objects*) have no
real purpose in Javascript. Arrays and Objects are different. They
inherently
have object nature, and it makes sense that their prototype is on the
constructor
as for all other constructors.
/L
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]