07 2017 档案

JS try和catch
摘要:try { // 此处是可能产生例外的语句 } catch(error) { // 此处是负责例外处理的语句 } finally { // 此处是出口语句 } 上述代码中,try块中的语句首先被执行。如果运行中发生了错误,控制就会转移到位于catch块中语句,其中括号中的error参数被作为例外变量 阅读全文

posted @ 2017-07-26 17:23 zkBlog 阅读(297) 评论(0) 推荐(0)

JS call和apply
摘要:function Class11() { this.showAdd = function(a,b) { return (a+b); } } function Class2() { Class10.call(this); Class11.call(this); } var Class2=new Cla 阅读全文

posted @ 2017-07-26 15:33 zkBlog 阅读(87) 评论(0) 推荐(0)

javascript 原型和构造函数
摘要:var animal=function(){} var dog= funciton(){} var tidy =new dog() 实例化一个对象 没有prototype只有__proto__ 所以 tidy.__proto__ animal .prototype tidy.__proto__.__ 阅读全文

posted @ 2017-07-26 15:16 zkBlog 阅读(178) 评论(0) 推荐(0)