数据类型

undefind

null

boolean

number

string

object

type of

功能:检测变量类型

语法:type of 变量或 type of (变量)

console.log() // 在控制台中打印

undefined的类型: 指是变量没有赋值

null :null指表示一个空对象指针

如果定义的变量准备在将来用来用于保存对象,那么最好将该变量初始值为null,而不是其他值

说明:

undefined值是派生自null值的,所以undefined == null 的返回结果是true。

 

 

 

 

 

 

 

       

相关文章:

  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2018-08-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案