Para saber o tipo da variavel
typeof "aawdaw"
'string'
typeof NaN
'number'
typeof null
'object'
Colocar o valor null dentro da variável muda o tipo dela
The latest ECMAScript standard defines nine types:
typeof instance === "object"
. Special non-data but Structural type for any constructed object instance also used as data structures: new Object
, new Array
, new Map
, new Set
, new WeakMap
, new WeakSet
, new Date
and almost everything made with new keyword;typeof
operator: typeof instance === "function"
. This is merely a special shorthand for Functions, though every Function constructor is derived from Object constructor.