JS 的 typeof 可以省略括号,JS 中的判断基本数据类型的四个方法: typeof, instanceof, constructor, prototype
JS 如何判断数据类型
在 JS 中有许多中提供了几个原生的判断数据类型方法,本文主要介绍 JS 中的判断基本数据类型的四个方法: typeof, instanceof, constructor, prototype
typeof
相信用 JS 的都肯定用过 typeof 来判断一些基本类型,但可能很多人都会误以为 typeof 是一个函数。
实际上 typeof 并不是一个函数,也不...
转载
2019-12-05 10:46:21 ·
498 阅读 ·
0 评论