타입체크
-
Modren JS - 타입 체크신나는 JavaScript 2023. 1. 16. 11:33
자바스크립트는 동적 타입 언어임. 개발자가 타입지정을 따로 하지않음 1.typeof typeof ''; // string typeof 1; // number typeof NaN; // number typeof true; // boolean typeof []; // object typeof {}; // object typeof new String(); // object typeof new Date(); // object typeof /test/gi; // object typeof function () {}; // function typeof undefined; // undefined typeof null; // object (설계적 결함) typeof undeclared; // undefined (설계적 ..