Skip to content

Commit fecb245

Browse files
committed
Automatic merge from master.
1 parent 0ec5abd commit fecb245

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

index.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ <h1>JavaScript Garden</h1>
538538
scope either via a <code>var</code> statement or being the name of a formal parameter,
539539
the <code>arguments</code> object will not be created.</p>
540540
</aside>
541-
<p>The <code>arguments</code> variable is <strong>not</strong> an <code>Array</code>. While it has some of the
541+
<p>The <code>arguments</code> object is <strong>not</strong> an <code>Array</code>. While it has some of the
542542
semantics of an array - namely the <code>length</code> property - it does not inherit from
543543
<code>Array.prototype</code> and is in fact an <code>Object</code>.</p>
544544
<p>Due to this, it is not possible to use standard array methods like <code>push</code>,
@@ -582,7 +582,7 @@ <h1>JavaScript Garden</h1>
582582
<p>The <code>arguments</code> object creates getter and setter functions for both its properties
583583
as well as the function's formal parameters.</p>
584584
<p>As a result, changing the value of a formal parameter will also change the value
585-
corresponding formal parameter, and the other way around.</p>
585+
of the corresponding property of the arguments object, and the other way around.</p>
586586
<pre><code>function foo(a, b, c) {
587587
arguments[0] = 2;
588588
a; // 2
@@ -597,11 +597,12 @@ <h1>JavaScript Garden</h1>
597597
foo(1, 2, 3);
598598
</code></pre>
599599
</section><section><header><h3>Performance myths and truths</h3></header>
600-
<p>The <code>arguments</code> is, except for the two cases named at the start of this section,
601-
always created. It doesn't matter whether it is used or not. Both getters and
602-
setters are <strong>always</strong> created; thus, using it has nearly no performance impact
603-
at all, especially not in real world code where there is more than an access to
604-
the arguments object properties.</p>
600+
<p>The <code>arguments</code> object is always created the only two exceptions being the cases
601+
where it is declared as a name inside of a function or one of its formal
602+
parameters. It does not matter whether it is used or not.</p>
603+
<p>Both getters and setters are <strong>always</strong> created; thus, using it has nearly
604+
no performance impact at all, especially not in real world code where there is
605+
more than an access to the arguments object properties.</p>
605606
<aside>
606607
<p><strong>ES5 Note:</strong> These getters and setters are not created in strict mode.</p>
607608
</aside>

0 commit comments

Comments
 (0)