type of a value.
JS ⟩ value ⟩ type ⟩ name ⟩ typeof
JS ⟩ operator ⟩ unary ⟩ typeof
(unary operator) determines the type of a value. (👉 type name)
⛔typeof let/const/class in TDZ gets an error❗️
👉 compare: typeName()
'boolean'
Boolean
'string'
String
'number'
Number
'bigint'
BigInt
'symbol'
Symbol
'undefined'
undefined
'function'
function
method
arrow function
generator function
class
'object'
null ( null is a primitive❗️)
any other objects, like
Object
Array
RegExp
Date
object literal
instances of class
...
typeof null === "object" // true
typeName() - refined version of typeof.
typeof
Last updated 2 years ago