🍫Numbers
In JavaScript, a number is a numeric data type that can be an integer (e.g. 1, 2, 3) or a floating-point number (e.g. 1.5, 3.14, 5.0).
You can convert a number to a string by using the toString()
method:
You can also use the String()
function to convert a number to a string:
If you try to perform an operation that is not allowed for numbers (e.g. dividing a string by a number), the result will be NaN
, which stands for "Not a Number".
For example:
Let's look at an example of Numbers in the context of a Sports games
Last updated