Primitives

Primitive value types

  • Number (integer and floating-point)
  • Boolean (true or false) (Any object whose value is not undefined or null, including a Boolean object whose value is false, evaluates to true when passed to a conditional statement.)
  • null (special primitive value)
  • undefined (special primitive value)

Integer literals

  • A leading 0 (zero) indicates an octal value.
  • A leading 0x (or 0X) indicates a hexadecimal value.
  • Hexadecimal digits are 0-9, a-f, and A-F.
42
0xFFF
-345

Float literals

3.1415
-3.1E12
.1e12
2E-12

Boolean literals

true
false

Resources URL: 
notes/javascript/resources
Sources URL: 
notes/javascript/sources

See Also