Creating a Numeric Variable

Creating a Numeric Variable

When working with data and variables in JavaScript,you need to be aware of the data types you are using.Different data types are managed in different
ways,and it is important to understand a few fundamental data types. One such data type is a number.

A number refers to any number,positive or negative,that contains only numbers,minus signs,and decimal points.When specifying a number in JavaScript,you should not enclose the string in single or double quotes; if you do,it will be treated as a text string and not a number. For instance,the following are valid numbers:
100
-152.56
But the following are not valid text strings:
“250.3”
ab32
In the first case,the quotes make the value a text string,and in the second,the letters mean this is not a valid numeric value.
You use these numbers in different contexts —for instance,as arguments to a function or method:
document.write(375);
You also use them as values assigned to variables:
var aVar = 375;
Note: There are a number of different data types in JavaScript. The most basic types are numbers (numeric values), strings (text), and boolean (binary, either-or, values typically represented as true/false or 1/0).

DOWNLOAD SOLUTION HERE