摘要: // js有6种数据类型:Undefined、Null、Boolean、String、Number、Object //(01)typeof console.log(typeof undefined); //undefined console.log(typeof null); //object :特殊1 console.log(typeof true); //boolean con... 阅读全文
posted @ 2017-02-22 17:15 爱笑的3 阅读(215) 评论(0) 推荐(0) 编辑
摘要: //声明(有参数、有返回值) function fun() { var name = '小黑'; if (arguments.length > 0) { name = arguments[0]; //接受参数 } alert(name); return name; // return ,退出当前函数(不再执行下面的语句) ;... 阅读全文
posted @ 2017-02-22 14:09 爱笑的3 阅读(323) 评论(0) 推荐(0) 编辑
摘要: //声明方式 //调用 Object构造函数创建 var user = new Object(); user.name = "小白"; user.say = function () { alert("我的名字:" + name); }; //字面量方式创建 var user2 = { name: "小白2", say: function () { ... 阅读全文
posted @ 2017-02-22 10:55 爱笑的3 阅读(259) 评论(0) 推荐(0) 编辑