- This function is used to convert object arguments into numbers, which represent the object value.
- If the specified value cannot be converted into a legal number, NaN is returned.
In some instances, the specified value cannot be converted into a legal number. Then,
NaN is returned instead.
var var1 = false;
var var2 = true;
var var3 = "123";
var var4 = "123 456";
var num =
Number(var1) + "<br>" +
Number(var2) + "<br>" +
Number(var3) + "<br>" +
Note: In case the parameter happens to be a date object, this function will return the number of milliseconds that have passed from 1970 UTC, January 1st, midnight, to now.
- Easy to use with a learn-by-doing approach
- Offers quality content
- Gamified in-browser coding experience
- The price matches the quality
- Suitable for learners ranging from beginner to advanced
- Free certificates of completion
- Focused on data science skills
- Flexible learning timetable
- Simplistic design (no unnecessary information)
- High-quality courses (even the free ones)
- Variety of features
- Nanodegree programs
- Suitable for enterprises
- Paid Certificates of completion
NaN which means that the variable is not a number.
|Returns object values if they can be translated into legal numbers.
Returns NaN if a value cannot be converted into a legal number.
Returns 0 if no argument is provided.