반응형
console.log(typeof 'John');
=> string

console.log(typeof 3.14);
=> number

console.log(typeof NaN);
=> number

console.log(false);
=> false  => boolean임.

console.log(typeof [1, 2, 3, 4]);
=> object

console.log(typeof {name:'John', age:34});
=> object

console.log(typeof new Date());
=> object

console.log(typeof function () {});
=> function

console.log(typeof myCar);
=> undefined

console.log(typeof null);
=> undefined
반응형

+ Recent posts