자바스크립트는 동적타입언어이다.
typeof : 데이터 타입을 확인해주는 연산자
var test;
console.log(typeof test); // undefined
test = 1;
console.log(typeof test); // number
test = 'JavaScript';
console.log(typeof test); // string
test = true;
console.log(typeof test); // boolean
test = null;
console.log(typeof test); // object
// 자바스크립트의 첫 번째 버전의 버그이지만 기존 코드에 영향을 줄 수 있어 아직까지 수정 되지 못하고 있다.
test = Symbol();
console.log(typeof test); // symbol
test = {}; // 객체
console.log(typeof test); // object
test = []; // 배열
console.log(typeof test); // object
test = function(){}; // 함수
console.log(typeof test); // function