- symbol (new in ECMAScript 2015)
// Strings "Hello World with double quotes" 'Hello World with single quotes' "28" // see note
[thesis_block type=”note” header=”” content=”Note: Numbers wrapped in quotes are treated as strings.”]
// Numbers 2 5.6 -3
Booleans are simply true or false which makes they extremely useful for conditional statements and logic.
// Booleans true false
undefined. Undefined represents a lack of existence.
var a; // undefined var b = "I have a value!";
null also represents a lack of existence, but this time you can set this value yourself when you want to set a variable equal to nothing.
var a = null; // null - equal to nothing var b = "I have a value!";
According to MDN, “a symbol is a unique and immutable data type. It may be used as an identifier for object properties.”
This will be updated once I become more familiar with the symbol primitive as we move to ES6.