Skip to content

Commit 4ded7ec

Browse files
committed
Updates!
1 parent 1d53a09 commit 4ded7ec

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

index.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -332,21 +332,21 @@ <h1>JavaScript Garden</h1>
332332
<pre><code>this;
333333
</code></pre>
334334
<p>When using <code>this</code> in global scope, it will simply refer to the <em>global</em> object.</p>
335-
</section><section><header><h3>Calling a Function</h3></header>
335+
</section><section><header><h3>Calling a function</h3></header>
336336
<pre><code>foo();
337337
</code></pre>
338338
<p>Here <code>this</code> will again refer to the <em>global</em> object.</p>
339-
</section><section><header><h3>Calling a Method</h3></header>
339+
</section><section><header><h3>Calling a method</h3></header>
340340
<pre><code>test.foo();
341341
</code></pre>
342342
<p>In this example <code>this</code> will refer to <code>test</code>.</p>
343-
</section><section><header><h3>Calling a Constructor</h3></header>
343+
</section><section><header><h3>Calling a constructor</h3></header>
344344
<pre><code>new foo();
345345
</code></pre>
346346
<p>A function call that is preceded by the <code>new</code> keyword acts as
347347
a <a href="#constructors">constructor</a>. Inside the function <code>this</code> will refer to a newly
348348
created <code>Object</code>.</p>
349-
</section><section><header><h3>Explicit setting</h3></header>
349+
</section><section><header><h3>Explicit setting of <code>this</code></h3></header>
350350
<pre><code>function foo(a, b, c) {}
351351

352352
var bar = {};
@@ -386,7 +386,7 @@ <h1>JavaScript Garden</h1>
386386
}
387387
</code></pre>
388388
<p><code>that</code> is just a normal name, but it is commonly used for the reference to an
389-
outer <code>this</code>. In combination with <a href="#closures">Closures</a>, it can also be used to
389+
outer <code>this</code>. In combination with <a href="#closures">closures</a>, it can also be used to
390390
pass <code>this</code> values around.</p>
391391
</section><section><header><h3>Assigning methods</h3></header>
392392
<p>Another thing that does <strong>not</strong> work in JavaScript is <strong>assigning</strong> a method
@@ -523,7 +523,7 @@ <h1>JavaScript Garden</h1>
523523
will override the default <code>arguments</code> object.</p>
524524
</aside></section></article>
525525

526-
<article><section><header><h2 id="scopes">Scopes and Namespaces <a href="#intro">^</a></h2></header>
526+
<article><section><header><h2 id="scopes">Scopes and namespaces <a href="#intro">^</a></h2></header>
527527
<p>Although JavaScript deals fine with the block scope syntax of two matching curly
528528
braces, it does <strong>not</strong> support block scope; thus, all that is left is the
529529
<em>function scope</em>.</p>
@@ -538,7 +538,7 @@ <h1>JavaScript Garden</h1>
538538
<p>Each time a variable is referenced, JavaScript will traverse upwards through all
539539
the scopes until it finds it. In the case that it reaches the global scope and
540540
still has not found the requested name, it will raise a <code>ReferenceError</code>.</p>
541-
</section><section><header><h3>The Bane of global Variables</h3></header>
541+
</section><section><header><h3>The bane of global variables</h3></header>
542542
<pre><code>// script A
543543
foo = '42';
544544

@@ -637,8 +637,8 @@ <h1>JavaScript Garden</h1>
637637
) // and return the function object
638638
() // call the result of the evaluation
639639
</code></pre>
640-
<p>There are other ways for evaluating and calling the function expression which -
641-
while different in syntax - do the exact same thing.</p>
640+
<p>There are other ways for evaluating and calling the function expression; which
641+
while different in syntax, do the exact same thing.</p>
642642
<pre><code>// Two other ways
643643
+function(){}();
644644
(function(){}());
@@ -901,8 +901,8 @@ <h1>JavaScript Garden</h1>
901901
will <strong>only</strong> print out <code>moo</code>. When <code>hasOwnProperty</code> is left out, the code is
902902
prone to errors when the native prototypes have been extended; for example,
903903
<code>Object.prototype</code>.</p>
904-
<p>One widely used framework which does this is <a href="http://www.prototypejs.org/"><strong>Prototype</strong></a>. When this
905-
framework is included, <code>for in</code> loops that doe not use <code>hasOwnProperty</code> are
904+
<p>One widely used framework which does this is <a href="http://www.prototypejs.org/">Prototype</a>. When this
905+
framework is included, <code>for in</code> loops that do not use <code>hasOwnProperty</code> are
906906
guaranteed to break.</p>
907907
</section><section><header><h3>Best practices</h3></header>
908908
<p>It is recommended to <strong>always</strong> use <code>hasOwnProperty</code>. Never should any
@@ -947,10 +947,10 @@ <h1>JavaScript Garden</h1>
947947
following strings. <code>Arguments</code>, <code>Array</code>, <code>Boolean</code>, <code>Date</code>, <code>Error</code>,
948948
<code>Function</code>, <code>JSON</code>, <code>Math</code>, <code>Number</code>, <code>Object</code>, <code>RegExp</code>, <code>String</code>.</p>
949949
</aside>
950-
<p>In order to retrieve the value of <em>Class</em> one can has to make use of the
950+
<p>In order to retrieve the value of <code>[[Class]]</code> one can has to make use of the
951951
<code>toString</code> method of <code>Object</code>.</p>
952952
</section><section><header><h3>The Class of an object</h3></header>
953-
<p>The specification gives exactly one way of accessing the <em>Class</em> value.</p>
953+
<p>The specification gives exactly one way of accessing the <code>[[Class]]</code> value.</p>
954954
<pre><code>function is(type, obj) {
955955
var cls = Object.prototype.toString.call(obj).slice(8, -1);
956956
return cls === type;
@@ -959,8 +959,8 @@ <h1>JavaScript Garden</h1>
959959
is('String', 'test'); // true
960960
is('String', new String('test')); // true
961961
</code></pre>
962-
<p><code>Object.prototype.toString</code> gets called with <a href="#this">this</a>
963-
being set to the object which its <em>Class</em> value should be retrieved.</p>
962+
<p><code>Object.prototype.toString</code> gets called with the value of <a href="#this">this</a> being set
963+
to the object whose <code>[[Class]]</code> value should be retrieved.</p>
964964
</section><section><header><h3>Testing for undefined variables</h3></header>
965965
<pre><code>typeof foo !== 'undefined'
966966
</code></pre>

0 commit comments

Comments
 (0)