Skip to content

Commit b69faa4

Browse files
committed
Update
1 parent 1352b4c commit b69faa4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,8 @@ <h1>JavaScript Garden</h1>
381381
<pre><code>function foo(a, b, c) {}
382382

383383
var bar = {};
384-
foo.call(bar, [1, 2, 3]);
385-
foo.apply(bar, 1, 2, 3);
384+
foo.apply(bar, [1, 2, 3]); // array will expand to the below
385+
foo.call(bar, 1, 2, 3); // results in a = 1, b = 2, c = 3
386386
</code></pre>
387387
<p>When using the <code>call</code> or <code>apply</code> methods of <code>Function.prototype</code>, the value of
388388
<code>this</code> inside the called function gets explicitly set to the first argument of
@@ -422,7 +422,7 @@ <h1>JavaScript Garden</h1>
422422
</section><section><header><h3>Assigning methods</h3></header>
423423
<p>Another thing that does <strong>not</strong> work in JavaScript is <strong>assigning</strong> a method
424424
reference to a variable.</p>
425-
<pre><code>var test = someObject.methodTest();
425+
<pre><code>var test = someObject.methodTest;
426426
test();
427427
</code></pre>
428428
<p>Again due to the first case <code>test</code> now acts like like a plain function call;

0 commit comments

Comments
 (0)