String, Number, Boolean, Array, Object, Null, Undefined.
A string is a variable which stores a series of characters like "John Doe".
A string can be any text inside quotes. You can use simple or double quotes:
You can use quotes inside a string as long as they don't match the quotes surrounding the string:
Or you can put quotes inside a string by using the \ escape character:
Numbers can be with or without decimals:
The maximum number of decimals is 17.
Extra large or extra small numbers can be written with scientific notation:
Booleans can have only two values: true or false.
The following code creates an Array object called myCars:
or (condensed array):
or (literal array):
An object is delimited by curly braces. Inside the braces the object's properties are defined as name and value pairs (name : value). The properties are separated by commas:
The object (person) in the example above has 3 properties: fistname, lastname, and id.
Spaces and line breaks are not important:
You can address the object properties in two ways:
Null or Undefined
Non-existing is the value of a variable with no value.
Variables can be emptied by setting the value to null;
Declaring Variable Types
When you declare a new variable, you can declare its type using the "new" keyword: