1. 类型类型分析: JS中数据类型有5种:string,number,boolean,undefined,object,前四种值类型(基础数据类型),object是引用类型 var a1; //undefined var a2=10; //number var a3="hello"; //string var a4=true; //boolean var a5=new Object(); //0bject var a6=NaN; //number var a7=null; //obj…
1.类型分析: js中的数据类型有undefined,boolean,number,string,object等5种,前4种为原始类型,第5种为引用类型. 代码 var a1; var a2 = true; var a3 = 1; var a4 = "Hello"; var a5 = new Object(); var a6 = null; var a7 = NaN; var a8 = undefined; alert(typeof a); //显示"undefined&…