1.2.15 Number

Like the other types of date above, JavaScript number items have many built-in methods to help make number manipulation and programming easier. For example, there might be times in your programming that you want to ensure you are working with a number to avoid breaking your program.


Note: Due to how StackBlitz works, the console will show up differently. When opened and viewed through the browser, it should show as followed in the image below as NaN.

Image showing console stating, 'NaN'.

This might cause an error in our program. We can check if a value is a number or not with the number method isNaN…

Check out the Mozilla Developer Network for more information on built-in objects.