用JS判断数据类型(常见四种)

常用的js判断数据类型(number、boolean、symbol、string、object、undefined、function)方法有三种: typeof判断 toString判断 constructor instanceof typeof判断 typeof判断基本类型可以(null除外,null也返回object),但是指引类型均返回object,如图: toString判断 toStri
相关文章
相关标签/搜索