타입 및 객체 체크
const num = 1.1;
const num2 = NaN;
const num3 = Infinity;
console.log(typeof num);
console.log(typeof num2);
console.log(typeof num3);const str1 = '';
const str2 = '1';
const str3 = 'str';
console.log(typeof str1 === 'string');
console.log(typeof str2 === 'string');
console.log(str3.constructor === String);Last updated