Skip to content

Commit d0d1f59

Browse files
committed
Fixed up sentence structure, some typos
1 parent e2b62d9 commit d0d1f59

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

doc/objects.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Everything in JavaScript acts like an object, with the only two exceptions being
1010
Foo.bar = 1;
1111
Foo.bar; // 1
1212

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
1414
objects. That is because a flaw in JavaScript's parser tries to parse the *dot
1515
notation* on a number as a floating point literal.
1616

@@ -39,7 +39,7 @@ object [inherits](#prototype) from `Object.prototype` and has no
3939

4040
### Accessing properties
4141

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
4343
notation, or the square bracket notation.
4444

4545
var foo = {name: 'Kitten'}
@@ -52,7 +52,7 @@ notation, or the square bracket notation.
5252
foo.1234; // SyntaxError
5353
foo['1234']; // works
5454

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
5656
the square bracket notation allows for dynamic setting of properties, as well as
5757
the use of property names that would otherwise lead to a syntax error.
5858

@@ -76,8 +76,8 @@ value associated with the property, but not the key.
7676
console.log(i, '' + obj[i]);
7777
}
7878
}
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
8181
removed and is therefore missing from the output.
8282

8383
### Notation of keys
@@ -88,12 +88,11 @@ removed and is therefore missing from the output.
8888
};
8989

9090
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
9292
a `SyntaxError`.
9393

9494
This error arises from the fact that `delete` is a *keyword* of the language;
9595
therefore, it must be notated as a string literal in order to ensure working
9696
code under older JavaScript engines.
9797

98-
[1]: http://en.wikipedia.org/wiki/Hashmap
99-
98+
[1]: http://en.wikipedia.org/wiki/Hashmap

0 commit comments

Comments
 (0)