Variables...arecase-sensitive, must begin with aletter,dollar sign ($)or aunderscore characterand contain no spaces... The variable should contain only letters, numbers, a dollar sign or underscore. number1 moms_phone_number $firstName _123test Not: 1number moms phone number "firstName"
Declaring variablesWith the keywordvar: var x = 42 (local or global variables). With the keywordlet: let y = 13. (local variable).
LocalVariables - A local variable will be visible only within a function where it is defined. After a variable has been defined, its name can be used as an expression. The value of such an expression is the value the variable currently holds. Here is an example: var ten = 10; console.log(ten * ten); // ? 100