aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeki <zekixfly@hotmail.com>2021-04-16 21:21:58 +0800
committerIrvin <irvinfly@gmail.com>2021-04-19 16:10:01 +0800
commitd63c860c073c4a6ab290ca210eea377717252885 (patch)
treea7c6e0497aa172154dac259657768d3cbda05188
parent3499c7bfd4d3ed8c50bf8b1a1c389cc4de4e74bf (diff)
downloadtranslated-content-d63c860c073c4a6ab290ca210eea377717252885.tar.gz
translated-content-d63c860c073c4a6ab290ca210eea377717252885.tar.bz2
translated-content-d63c860c073c4a6ab290ca210eea377717252885.zip
Fix Arrow_functions doc page
fix line:210. The program notes should be printed out // 印出 undefined, Window {...} (or the global object) fix line:223. The program notes add ','
-rw-r--r--files/zh-tw/web/javascript/reference/functions/arrow_functions/index.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/files/zh-tw/web/javascript/reference/functions/arrow_functions/index.html b/files/zh-tw/web/javascript/reference/functions/arrow_functions/index.html
index 8eac06ba55..82285afeae 100644
--- a/files/zh-tw/web/javascript/reference/functions/arrow_functions/index.html
+++ b/files/zh-tw/web/javascript/reference/functions/arrow_functions/index.html
@@ -207,7 +207,7 @@ var obj = {
console.log(this.i, this);
}
}
-obj.b(); // 印出 undefined, Object {...}
+obj.b(); // 印出 undefined, Window {...} (or the global object)
obj.c(); // 印出 10, Object {...}</code></pre>
<p>箭頭函式並沒有自己的 <code>this</code>。另一個例子與 {{jsxref("Object.defineProperty()")}} 有關:</p>
@@ -220,7 +220,7 @@ var obj = {
Object.defineProperty(obj, 'b', {
get: () =&gt; {
- console.log(this.a, typeof this.a, this); // undefined 'undefined' Window {...} (or the global object)
+ console.log(this.a, typeof this.a, this); // undefined, 'undefined', Window {...} (or the global object)
return this.a + 10; // represents global object 'Window', therefore 'this.a' returns 'undefined'
}
});