Literal values in JavaScript (numbers, strings, booleans, etc.)
- Numbers (42, 2.3, NaN, Infinity, -Infinity)
- Strings ("", '')
- Booleans (true, false)
- null
- undefined
- Objects (incl. Arrays, Functions)
examples/js/literal_values.js
console.log(42); console.log(2.3); console.log("hello"); console.log('world'); console.log(undefined); console.log(null); console.log(NaN); console.log(Infinity); console.log(-Infinity); console.log(true); console.log(false);
- Numbers in JavaScript is 64-bit floating point (double)
- Regular arithmetic issues 0.1+0.2 is not exactly 0.3