var val=5; // integer value assigned to the variable val
var val=5.2; // a decimal value 5.2 is assigned to the variable val
var val=true; // a boolean value true is assigned to the variable val
Note: Browser can understand from the assigned value the type of data assigned to the variable.
To better understand the above point, lets take one example.
The above code would print 2.4