You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
876 B
876 B
Javascript Fundamentals Review
Primative Data Types
Javascript has several basic data types:
'this is a string' // string (text)
123 // number (int)
1.2 // number (float)
true // boolean
false // boolean
[1,2,3] // object (array)
{
prop1: 'value1',
prop2: 'value1'
} // object
null // object (null)
undefined // undefined
Variables
Declaring variables is done with the keyword var. Variables are dynamically typed (decided during execution) since there is no compilation process.
var foo = 'string';
var bar = 1;
Variables can be reassigned to any other value by omitting the var keyword
var foo = 'a string';
foo = 123.4;