Reputation: 433
I'm new to JavaScript. Can you please explain, why we have two functions that acting the same? what is the purpose of both?
ToNumber("100");
and
Number("100");
Upvotes: 5
Views: 10698
Reputation: 382274
Only one is standard : Number
There's no standard ToNumber
function. There's only an abstract ToNumber operation used as a description of a conversion process involved in many operations in the ECMAScript specification. If you have in your code a working call to ToNumber
, this function was probably provided by a library you're using.
Upvotes: 13