@@ -36,7 +36,7 @@ <h1>JavaScript Garden</h1>
36
36
< li > < a href ="#eval "> Reasons against < code > eval</ code > </ a > </ li >
37
37
< li > < a href ="#timeouts "> < code > setTimeout</ code > and < code > setInterval</ code > </ a > </ li >
38
38
< li > < a href ="#semicolon "> Automatic semicolon insertion</ a > </ li >
39
- </ ul > </ section >
39
+ </ ul >
40
40
</ nav >
41
41
42
42
< header >
@@ -115,7 +115,7 @@ <h1>JavaScript Garden</h1>
115
115
the use of property names that would otherwise lead to a syntax error.</ p >
116
116
</ section > < section > < header > < h3 > Deleting properties</ h3 > </ header >
117
117
< p > The only way to actually remove a property from an object is to use the < code > delete</ code >
118
- operator; setting the property to < code > undefined</ code > or < code > null</ code > does < strong > only</ strong > remove the
118
+ operator; setting the property to < code > undefined</ code > or < code > null</ code > < strong > only</ strong > remove the
119
119
value associated with the property, but not the key.</ p >
120
120
< pre > < code > var obj = {
121
121
bar: 1,
@@ -132,7 +132,7 @@ <h1>JavaScript Garden</h1>
132
132
}
133
133
}
134
134
</ code > </ pre >
135
- < p > The above outputs both < code > bar undefined</ code > and < code > foo null</ code > - only < code > baz</ code > got actually
135
+ < p > The above outputs both < code > bar undefined</ code > and < code > foo null</ code > - only < code > baz</ code > was
136
136
removed and is therefore missing from the output.</ p >
137
137
</ section > < section > < header > < h3 > Notation of keys</ h3 > </ header >
138
138
< pre > < code > var test = {
@@ -143,9 +143,9 @@ <h1>JavaScript Garden</h1>
143
143
< p > Object properties can be both notated as plain characters and as strings. Due to
144
144
another mis-design in JavaScript's parser, the above will throw
145
145
a < code > SyntaxError</ code > prior to ECMAScript 5.</ p >
146
- < p > This error arises from the fact that < code > delete</ code > is a < em > keyword</ em > of the language;
147
- therefore, it must be notated as a < em > string literal</ em > in order to ensure working
148
- code under older JavaScript engines.</ p > </ section > </ article >
146
+ < p > This error arises from the fact that < code > delete</ code > is a < em > keyword</ em > ; therefore, it must be
147
+ notated as a < em > string literal</ em > to ensure that it will be correctly interpreted by
148
+ older JavaScript engines.</ p > </ section > </ article >
149
149
150
150
< article > < section > < header > < h2 id ="prototype "> The prototype < a href ="#intro "> #top</ a > </ h2 > </ header >
151
151
< p > JavaScript does not feature a classical inheritance model, instead it uses a
@@ -230,7 +230,7 @@ <h1>JavaScript Garden</h1>
230
230
other built in prototypes.</ p >
231
231
< p > This technique is called < a href ="http://en.wikipedia.org/wiki/Monkey_patch "> monkey patching</ a > and breaks < em > encapsulation</ em > . While
232
232
used by widely spread frameworks such as < a href ="http://prototypejs.org/ "> Prototype</ a > , there is still no good
233
- reason for cluttering built in types with additional < em > non-standard</ em > functionality.</ p >
233
+ reason for cluttering built- in types with additional < em > non-standard</ em > functionality.</ p >
234
234
< p > The < strong > only</ strong > good reason for extending a built-in prototype is to backport
235
235
the features of newer JavaScript engines; for example,
236
236
< a href ="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/forEach "> < code > Array.forEach</ code > </ a > .</ p >
@@ -1244,7 +1244,7 @@ <h1>JavaScript Garden</h1>
1244
1244
< p > By using the < strong > not</ strong > operator twice, a value can be converted a boolean.</ p >
1245
1245
< pre > < code > !!'foo'; // true
1246
1246
!!''; // false
1247
- !!'0'; // false
1247
+ !!'0'; // true
1248
1248
!!'1'; // true
1249
1249
!!'-1' // true
1250
1250
!!{}; // true
0 commit comments