On Feb 4, 10:06 am, Angus Croll <[email protected]> wrote:
 [...]
> I've never yet had to use new
> Number() but there may yet be a scenario
 [...]

If you want a consistent way to evaluate and "enforce" the type of
individual values through the  instanceof operator, this would be the
approach to use.

new String()  can also have some utility as with it you could simulate
Mozilla's string indexing:

var foo = new String("myString");  //where the constructor creates
numeric members

foo[2]; //"S"

Not saying that these are necessarily wise decisions, but they are
examples of possible uses for primitive wrappers.

-- 
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]

Reply via email to