typeof "string" // "string" typeof 123 // "number" typeof 1.2 // "number" typeof 1/0 // NaN ?? typeof 할때 계산은 미리 하고 진행하자. 이상하다. typeof (1/0) // "number" ?? typeof 0/1 // NaN ?? typeof (0/1) // "number" ?? 1/0 // Infinity typeof Infinity // "number" typeof false // "boolean" typeof afssddfd // "undefined" typeof null // "object" !!! typeof [] // "object" typeof new Array("12") // "object" typeof {} // "object" typeof new Object() // "object" typeof function(){} // "function" typeof alert // "function" 1/0 // Infinity 1-"a" // NaN 1-"12" // -11 // [1,2] instanceof Object [1,2] instanceof Array new String("as") instanceof Object new String("as") instanceof String new Boolean("false") instanceof Object new Boolean("false") instanceof Boolean "121" instanceof String // false ?? false instanceof Boolean // false ?? "121" instanceof Object // false ?? false instanceof Object // false ?? window instanceof Window window instanceof Object
'웹 > javascript' 카테고리의 다른 글
chrome console 기능 (0) | 2018.05.22 |
---|---|
NaN !== NaN (0) | 2018.05.22 |
setTimeout 과 this (0) | 2018.05.19 |
css (0) | 2018.05.02 |
Browsersync, VSCode, Brackets (0) | 2018.05.01 |