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
Was this helpful?