Tipos primitivos:
console.log(typeof "Rojo"); // string
console.log(typeof 21); //number
console.log(typeof true); // boolean
console.log(typeof undefined); // undefined
console.log(typeof Symbol()); // symbol
console.log(typeof 2n); // bigint
console.log(typeof null); // object
null
es primitivo pese a que nos da object
, ello por un bug que tiene el lenguaje como tal.
Objetos
console.log(typeof {}); // object
console.log(typeof []); // object
console.log(typeof function () { }); //function
Las funciones son utilizan el constructor Object
pero con una pequeรฑa variante, pero en el fondo son objetos.