Javascript Variables and Data Types : Javascript Essentials
Variables are symbolic names for values. Variables are used to store dynamic values in it. The names of variables, or identifiers, must follow certain rules. A JavaScript variable name must start with a letter, underscore (_); subsequent characters can also be digits (0-9). As JavaScript is case sensitive, letters include the characters A through Z (uppercase) and the characters a through z(lowercase). Variables in JavaScript should be defined with the var/let keyword. If you declare a variable without assigning a value to it, its type is undefined by default. let is used for block level scope variable declarations. JavaScript supports the standard variations of Data types: Number String Boolean Symbol (new in ECMAScript 6) Object: Function Array Date RegExp Null Undefined Number: A Number type is a combination both integer and floating, which can be decide automatically on assigning a value to variable. For example see below. var num = 22; Above declaration will be integer.