diff options
Diffstat (limited to 'files/zh-tw/web/javascript/reference/functions/method_definitions')
-rw-r--r-- | files/zh-tw/web/javascript/reference/functions/method_definitions/index.html | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/files/zh-tw/web/javascript/reference/functions/method_definitions/index.html b/files/zh-tw/web/javascript/reference/functions/method_definitions/index.html index 15aeef0f00..b56c884503 100644 --- a/files/zh-tw/web/javascript/reference/functions/method_definitions/index.html +++ b/files/zh-tw/web/javascript/reference/functions/method_definitions/index.html @@ -69,7 +69,7 @@ translation_of: Web/JavaScript/Reference/Functions/Method_definitions </li> </ul> -<pre class="brush: js;highlight[12]">// Using a named property +<pre class="brush: js">// Using a named property var obj2 = { g: function* () { var index = 0; @@ -95,7 +95,7 @@ console.log(it.next().value); // 1</pre> <p>{{jsxref("Statements/async_function", "Async 方法", "", 1)}} 也可以透過簡短語法定義。</p> -<pre class="brush: js;highlight[12]">// Using a named property +<pre class="brush: js">// Using a named property var obj3 = { f: async function () { await some_promise; @@ -150,7 +150,7 @@ new obj.g; // TypeError: obj.g is not a constructor (changed in ES2016) <h3 id="Simple_test_case">Simple test case</h3> -<pre class="brush: js;highlight[3]">var obj = { +<pre class="brush: js">var obj = { a: 'foo', b() { return this.a; } }; @@ -161,7 +161,7 @@ console.log(obj.b()); // "foo" <p>The shorthand syntax also supports computed property names.</p> -<pre class="brush: js;highlight[4]">var bar = { +<pre class="brush: js">var bar = { foo0: function() { return 0; }, foo1() { return 1; }, ['foo' + 2]() { return 2; } |