Click here to Skip to main content
15,911,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm new to JavaScript. Can you please explain, why we have two functions that acting the same? what is the purpose of both?

Java
ToNumber("100");

and
JavaScript
Number("100");
Posted

Hi,

Refer this article : ECMAScript® Language Specification
 
Share this answer
 
There is nothing ToNumber() defined by JavaScript. That might be a User Defined function.

Whereas Number() is a JavaScript Global Function. Refer - JavaScript Number() Function[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900