From e85fb1583a7014f651f605ab2ff121a04271fce6 Mon Sep 17 00:00:00 2001 From: Goofy Date: Tue, 22 Jun 2021 16:28:00 +0800 Subject: [PATCH] Update this.md --- 201711/this.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/201711/this.md b/201711/this.md index ed39816..027bb6f 100644 --- a/201711/this.md +++ b/201711/this.md @@ -108,7 +108,7 @@ foo.prototype.sayA = function () { console.log(this.a) } var bar = new foo(2) -foo.sayA() // 2 +bar.sayA() // 2 ``` 而尖头函数十分特别,你可以把它理解为 bind 函数的语法糖,它的 this 同外层函数的 this。 @@ -132,4 +132,4 @@ this 是 JavaScript 的一大难点,多年经验的前端程序员都可能对 ------ -作者:肖沐宸,[github](https://github.com/cheogo/learn-javascript)。 \ No newline at end of file +作者:肖沐宸,[github](https://github.com/cheogo/learn-javascript)。