@@ -10,7 +10,7 @@ Everything in JavaScript acts like an object, with the only two exceptions being
10
10
Foo.bar = 1;
11
11
Foo.bar; // 1
12
12
13
- A mis-assumption that is commonly made, is that number literals cannot be used as
13
+ A common misconception is that number literals cannot be used as
14
14
objects. That is because a flaw in JavaScript's parser tries to parse the * dot
15
15
notation* on a number as a floating point literal.
16
16
@@ -39,7 +39,7 @@ object [inherits](#prototype) from `Object.prototype` and has no
39
39
40
40
### Accessing properties
41
41
42
- The properties of an object can be accessed in two ways. Either via the dot
42
+ The properties of an object can be accessed in two ways, via either the dot
43
43
notation, or the square bracket notation.
44
44
45
45
var foo = {name: 'Kitten'}
@@ -52,7 +52,7 @@ notation, or the square bracket notation.
52
52
foo.1234; // SyntaxError
53
53
foo[ '1234'] ; // works
54
54
55
- Both notations are identical in their workings, the only difference being that
55
+ Both notations are identical in their workings, with the only difference being that
56
56
the square bracket notation allows for dynamic setting of properties, as well as
57
57
the use of property names that would otherwise lead to a syntax error.
58
58
@@ -76,8 +76,8 @@ value associated with the property, but not the key.
76
76
console.log(i, '' + obj[i]);
77
77
}
78
78
}
79
-
80
- The aboves outputs both ` bar undefined ` and ` foo null ` , only ` baz ` got actually
79
+
80
+ The above outputs both ` bar undefined ` and ` foo null ` - only ` baz ` got actually
81
81
removed and is therefore missing from the output.
82
82
83
83
### Notation of keys
@@ -88,12 +88,11 @@ removed and is therefore missing from the output.
88
88
};
89
89
90
90
Object properties can be both notated as plain characters and as strings. Due to
91
- another mis-design in JavaScript's parser, prior to EcmaScript 5 the above threw
91
+ another mis-design in JavaScript's parser, prior to ECMAScript 5 the above will throw
92
92
a ` SyntaxError ` .
93
93
94
94
This error arises from the fact that ` delete ` is a * keyword* of the language;
95
95
therefore, it must be notated as a string literal in order to ensure working
96
96
code under older JavaScript engines.
97
97
98
- [ 1 ] : http://en.wikipedia.org/wiki/Hashmap
99
-
98
+ [ 1 ] : http://en.wikipedia.org/wiki/Hashmap
0 commit comments