//typeof 연산자 사용방법
typeof 'Codeit'; // string
typeof Symbol(); // symbol
typeof {}; // object
typeof []; // object
typeof true; // boolean
typeof(false); // boolean
typeof(123); // number
typeof(NaN); // number
typeof(456n); // bigint
typeof(undefined); // undefined
한 가지 주의해야 할 점은 typeof 연산자의 결과가 모든 타입과 1:1로 매칭되지 않는다는 것이다.
typeof null; // object
함수에 typeof 연산자를 사용하면 function이라는 값을 리턴한다.
function sayHi() {
console.log('Hi!?');
}
typeof sayHi; // function