21. Primitive types #
Created Thursday 3 March 2022
- [ ] in vault
There are two kinds of variable types in JavaScript:
- Primitive types - just values
- Objects - name, value pairs. Value may be an object itself.
There are 7 types of primitive types in JS, at the point of this writing:
undefined
- non-existence of a value, given by the JS engine. Should not be assigned to by us. Checking for it is fine though.null
- non-existence of a value. This can be assigned by us.number
- a floating type number.string
- a string of characters. Immutable because there is nochar
in JS.boolean
- obvioussymbol
- ES6+, FIXME. We are ignoring this in this course.bigint
FIXME