1:六种数据类型:Undefined Null Boolean Number String Object
(大写开头,表示是一种类型)(会返回5种字符串)
分别是:undefined string boolean object(null和object) number
2:ECMAScript不支持任何创建自定义类型的机制
3:举例:
var box;
alert(box); //box值是undefined
alert(typeof box); //box是Undefined类型 类型返回的字符串是undefined
4:空对象:表示没有创建 就是一个null
空的对象:表示这个对象创建了,但是里面没东西
var box={};
alert(box);//box是Object类型 值是【object Object】
alert(typeof box);//类型返回的字符串是object
var box = new Object();
alert(box); //同理上面object值
5:var box=null;
alert(box);//类型是Null 值是null
alert(type null);//类型返回字符串object
6:function box(){
//之间的内容也会原样输出
}
alert();//box是Function函数 值是function box(){} 类型返回的字符串是function
7:var box;
alert(age);//输出一个不存在的变量 浏览器报错 age is not defined
//如果typeof age输出 返回undefined(类型返回字符串是undefined)
8:var box=null;//你还没有创建对象 但先声明了对象的引用而必须初始化的结果
9:undefined和null的值其实是相等的
但是他们的数据类型不相等 即如果用===全等符判断时不相等
10:alert输出数字都是以十进制输出