摘要: https://www.cnblogs.com/cxying93/p/6103375.html(copy) 我的理解是: 闭包就是能够读取其他函数内部变量的函数。 由于在javascript中,只有函数内部的子函数才能读取局部变量,所以说,闭包可以简单理解成“定义在一个函数内部的函数“。 所以,在本 阅读全文
posted @ 2019-05-21 16:05 ThisCall 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 函数中的this添加函数是加在对象上,而this.prototype是添加在原型上,通过prototype的指向来一级一级查找 prototype是构造函数访问原型对象,__proto__是对象实例访问原型对象 che.constructor指向构造函数 阅读全文
posted @ 2019-05-21 14:46 ThisCall 阅读(863) 评论(0) 推荐(0) 编辑
摘要: var a=function(){ this.che1 = function () { console.log(1) } this.che2 = function () { console.log(2) } this.che3=function(){console.log(3)} } var b= new a(); var c=... 阅读全文
posted @ 2019-05-21 12:01 ThisCall 阅读(103) 评论(0) 推荐(0) 编辑