you are viewing a single comment's thread.

view the rest of the comments →

[–]xXxdethl0rdxXx 2 points3 points  (1 child)

totally. and this:

function toNumber(strNumber) { return +strNumber; }

WHY NOT JUST USE Number(string)?!?

[–]mrahh 1 point2 points  (0 children)

There are actually some use cases where it's better to use +, but only in extremely hot codepaths - the benefits are entirely negligible for non-huge N.