var motorbikeprice = 3420; var phoneprice = 89.99; var spendingprice = -250.67; var savingprice = 0; var houseprice = 2.50e5;
e and the number
5 that follows it in the value of the variable
5 is the exponent of
10. It translates into
2.50 × 105.
String variables are variables that represent a string of text. The string of text, that represents the value of the variable, must be placed within quotation marks (single or double quotation marks are allowed) and it can contain letters, numbers, spaces or almost anything you like.
var mycomputer = "processor i5, 8GB of RAM"; var mymotorbike = "Honda PCX"; var mydog = "Flora";
var DanWebDeveloper = true; var DanHistorian = false;
Notice that the values
false are not placed between quotation marks. That is because they are recognized as Boolean values. Instead of using
false you can use
var DanWebDeveloper = 1; var DanHistorian = 0;
A null variable is a variable that has no value.
var DanHistorian = null;
As Boolean variables, the value