JavaScript中数据类型的判断
数据类型判断的常用方法
以下所有结果,由nodejs执行所得。
1. typeof
The typeof operator returns a string indicating the type of the unevaluated operand.
typeof返回操作对象的类型(字符串表示)。
语法:
typeof 操作对象
typeof(操作对象)
示例:
let str = new String('abc');
let array = [1,2,3];
console.log(typeof 8
翻译
2021-09-27 10:24:34 ·
64 阅读 ·
0 评论