Primitives number numbers of any kind: integer or floating-point, integers are limited by ±(253-1) bigint integer numbers of arbitrary length string strings. A string may have zero or more characters, there’s no separate single-character type boolean true/false. null unknown values – a standalone type that has a single value null undefined unassigned values – a standalone type that has a single value undefined symbol unique identifiers Objects object for more complex data structures function Typeof
typeof 0 // "number"
typeof "foo" // "string"
typeof ("foo") // "string"
Type conversion
String(true) // 'true'
Number(" 123 ") // 123
Number("123z") // NaN (error reading a number at "z")
Number(true) // 1
Number(false) // 0
Number(null) // 0
Number(undefined) // NaN
+true // 1
+"" // 0
+"123" // 123
Boolean(1) // true
Boolean(0) // false
Boolean("0") // true
Boolean(" ") // true
Boolean("hello") // true
Boolean("") // false