|
| JAVASCRIPT DATA TYPES
Javascript variables can store three of the main data types automatically without first having to declare beforehand what these data types are.
These three main data types are strings, numbers and boolean values (ie. true or false).
Examples:
Store strings
var username="John25";
var name="Mary Smith";
var email="john@somesite.com";
Store numbers
var total_eggs= 25;
var tax_rate= 0.14;
var population = 1246799;
Store Boolean Values
var people_present = true;
var did_buy = false;
|
|