js数据类型

 

JS中的原始数据类型:number,string,boolean,null,undefined,object

 

JS数据类型:JS的基本类型和引用类型

基本类型(单类型):除Object。 String、Number、boolean、null、undefined。

引用类型:object。里面包含的 function、Array、Date。

 

JS数据类型:JS 中 typeof 输出分别是

{ } 、[ ] 输出 object。

console.log( ) 输出 function

 

JS数据类型:null 和 undefined 有什么区别

Null 只有一个值,是 null。不存在的对象。

Undefined 只有一个值,是undefined。没有初始化。undefined 是从 null 中派生出来的。

简单理解就是:undefined 是没有定义的,null 是定义了但是为空。

 

posted @ 2022-01-02 21:43  qYp77  阅读(46)  评论(0)    收藏  举报