-
return this;是必须要有的。 这里的this指的是实例化的对象,在本案中就是manager。每次调用addClass方法,返回this,也就是manager,用于调用下一个addClass方法,使得链式调用成立。 所以,想要链式调用,就要在构造函数中增加return this;语句。查看全部
-
try后面必须至少有catch或finally try { 先执行,执行到throw时跳到最近的一层catch,处理完后回到throw继续执行 } catch(ex) { 捕获到异常则执行 } finally { 不论有无异常最后都会执行 }查看全部
-
block(块语句):{语句1;语句2;},没有块级作用域 var:var a=1; var a=1,b=1; break function continue return empty do...while debugger if...else for label switch for...in with try catch while查看全部
-
视频中学习资料的地址:https://developer.mozilla.org/zh-CN/learn/javascript查看全部
-
Object.prototype.toString.apply([]); //返回[object Array] Object.prototype.toString.apply(function(){}); //返回[object Function] Object.prototype.toString.apply(null); //返回[object Null],IE6/7/8返回[object Object] Object.prototype.toString.apply(undefined); //返回[object Undefined]查看全部
-
typeof 100 //"number" typeof true //boolean typeof function //function typeof (undefined) //undefined typeof new Object() //object typeof [1,2] // object typeof NaN // number typeof null //object typeof null === "object" //兼容性 obj instanceof Obj //obj是不是Obj类型 不同window或iframe间的对象类型检测不能用instanceof function Person(){}; function Student(){}; Student.prototype = new Person(); Student.prototype.constructor = Student var bosn = new Student() bosn instanceof Student // true var one = new Person() one instanceof Person // true one instanceof Student // false bosn instanceof Person // true查看全部
-
类型检查 typeof instanceof Object.prototype.toString constructor duck type查看全部
-
严格等于 === 不仅值想等,数据类型也要相等。查看全部
-
+/- 运算逻辑,-号会理解为数字运算 +号会理解为字符串拼接:查看全部
-
bosn 的原型的原型 指向了person查看全部
-
"1.23" == 1.23 0 == false null == undefined new Object() == new Object() [1,2] == [1,2]查看全部
-
var x = 'The answer is ' + 42; ////The answer is 42 var y = 42 + ' is the answer'; //42 is the answer "37" - 7 //30 "37" + 7 //377 类型转换: num - 0 //转换为数字 num + '' //转换为字符串查看全部
-
函数声明 前置查看全部
-
重点复习查看全部
-
复习查看全部
举报
0/150
提交
取消