diff --git "a/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/image-20221102093020435.png" "b/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/image-20221102093020435.png" new file mode 100644 index 0000000000000000000000000000000000000000..dfc0db5e857d9a8ebd5dc3ef959fbc5a7570bfa5 Binary files /dev/null and "b/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/image-20221102093020435.png" differ diff --git "a/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\344\275\234\344\270\232/.keep" "b/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\344\275\234\344\270\232/.keep" new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git "a/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\344\275\234\344\270\232/11.4.html" "b/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\344\275\234\344\270\232/11.4.html" new file mode 100644 index 0000000000000000000000000000000000000000..505624f4f7b29c2eb7939e69725bf9fdbb34bac9 --- /dev/null +++ "b/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\344\275\234\344\270\232/11.4.html" @@ -0,0 +1,67 @@ + + + + + + + Document + + + + + \ No newline at end of file diff --git "a/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\344\275\234\344\270\232/\346\226\260\345\273\272 \346\226\207\346\234\254\346\226\207\346\241\243.html" "b/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\344\275\234\344\270\232/\346\226\260\345\273\272 \346\226\207\346\234\254\346\226\207\346\241\243.html" new file mode 100644 index 0000000000000000000000000000000000000000..3ae5f3b5579468f3a1876082555e211ef6e1b69c --- /dev/null +++ "b/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\344\275\234\344\270\232/\346\226\260\345\273\272 \346\226\207\346\234\254\346\226\207\346\241\243.html" @@ -0,0 +1,93 @@ + + + + + + + Document + + + + + \ No newline at end of file diff --git "a/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\347\254\224\350\256\260/.keep" "b/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\347\254\224\350\256\260/.keep" new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git "a/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\347\254\224\350\256\260/11.4.md" "b/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\347\254\224\350\256\260/11.4.md" new file mode 100644 index 0000000000000000000000000000000000000000..6eabaefa2d8040b6a89287b250742ecbd7a1c6b4 --- /dev/null +++ "b/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\347\254\224\350\256\260/11.4.md" @@ -0,0 +1,33 @@ + //继承 + + //原型链继承 + //父类中新增的实例和子类的都可以使用 + //可以在子类中增加实例属性,如果要新增加原型属性和方法需要在new 父类构造函数的后面 + // function Father(){ + // this.say = function(){ + // console.log('父类'); + // } + // }; + // function Son(){}; + // Son.prototype = new Father(); + // var son = new Son(); + // son.say(); + + + //圣杯模式 + // function Father(){}; + // function Son(){}; + + // function inherit(Target,Origin){ + // function F(){}; + // F.prototype = Origin.prototype; + // Target.prototype = new F(); + // Target.prototype.constructor = Target; + // Target.prototype.uber = Origin; + // } + // inherit(Son,Father); + // Father.prototype.age = 25; + // Son.prototype.age = 10; + // console.log(Father.prototype.age); + // console.log(Son.prototype.age); + diff --git "a/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\347\254\224\350\256\260/\346\226\260\345\273\272 \346\226\207\346\234\254\346\226\207\346\241\243 (2).md" "b/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\347\254\224\350\256\260/\346\226\260\345\273\272 \346\226\207\346\234\254\346\226\207\346\241\243 (2).md" new file mode 100644 index 0000000000000000000000000000000000000000..9dbdc26ca064210b063950bd0676859190f1a741 --- /dev/null +++ "b/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\347\254\224\350\256\260/\346\226\260\345\273\272 \346\226\207\346\234\254\346\226\207\346\241\243 (2).md" @@ -0,0 +1,10 @@ +、闭包 var add = (function () { +var counter = 0; return function () { return counter += 1; } })(); + +add(); add(); add(); + +// 计数器目前是 3 个闭包由两部分组成,函数和创建该函数的环境。 + +由于闭包会携带包含它的函数的作用域,因此会比其他函数占用更多的内存。 + +闭包缺点:当函数保存在外部时,将会生成闭包,闭包会导致原有作用域链不释放,从而造成内存泄漏。 \ No newline at end of file diff --git "a/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\347\254\224\350\256\260/\346\226\260\345\273\272 \346\226\207\346\234\254\346\226\207\346\241\243.md" "b/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\347\254\224\350\256\260/\346\226\260\345\273\272 \346\226\207\346\234\254\346\226\207\346\241\243.md" new file mode 100644 index 0000000000000000000000000000000000000000..5337a2ddbc29f0b2c708e12d95cf956d27f98a92 --- /dev/null +++ "b/42\345\224\220\347\232\223\351\242\226/\347\254\224\350\256\260/\347\254\224\350\256\260/\346\226\260\345\273\272 \346\226\207\346\234\254\346\226\207\346\241\243.md" @@ -0,0 +1,19 @@ +1.创建GO对象 GO {} + +2.把声明的变量给到GO的属性 赋值为undefined + +GO { + + b: undefined + +} + +3. 找全局域中的函数声明,放到GO对象的属性,赋值为函数体 + +GO { + + b: undefined + + arr: function aaa() {} + +} 预解析完毕,执行代码 \ No newline at end of file