有关typeof运算符

2020-12-02  本文已影响0人  木羽木羽女口生
let a;                       typeof a    // 'undefined'
const str = 'abc';           typeof str  //'string'
const n = 100;               typeof n    //'number'
const b = true;              typeof b    //'boolean'
const s = Symbol('s');       typeof s    //'symbol'
typeof console.log     // 'function'
typeof function () {}  //'function'
typeof null         //'object'
typeof ['a','b']   //'object'
typeof{x:100}      //'object'
上一篇下一篇

猜你喜欢

热点阅读