Skip to content

Commit 9ad2ad6

Browse files
authored
Merge pull request #419 from MargaritD/master
minor suggested edits to Objects chapter
2 parents ebc46fd + ae6d739 commit 9ad2ad6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

1-js/04-object-basics/01-object/article.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ That can become a source of bugs and even vulnerabilies if we intent to store ar
224224
225225
In that case the visitor may choose "__proto__" as the key, and the assignment logic will be ruined (as shown above).
226226
227-
There exist a way to make objects treat `__proto__` as a regular property, we'll cover it later, but first we need to know more about objects to understand it.
227+
There is a way to make objects treat `__proto__` as a regular property, which we'll cover later, but first we need to know more about objects.
228228
There's also another data structure [Map](info:map-set-weakmap-weakset), that we'll learn in the chapter <info:map-set-weakmap-weakset>, which supports arbitrary keys.
229229
````
230230

@@ -368,7 +368,7 @@ Also, we could use another variable name here instead of `key`. For instance, `"
368368
369369
### Ordered like an object
370370
371-
Are objects ordered? In other words, if we loop over an object, do we get all properties in the same order that they are added in it? Can we rely on it?
371+
Are objects ordered? In other words, if we loop over an object, do we get all properties in the same order they were added? Can we rely on this?
372372
373373
The short answer is: "ordered in a special fashion": integer properties are sorted, others appear in creation order. The details follow.
374374
@@ -512,7 +512,7 @@ admin.name = 'Pete'; // changed by the "admin" reference
512512
alert(*!*user.name*/!*); // 'Pete', changes are seen from the "user" reference
513513
```
514514
515-
The example above demonstrates that there is only one object. Like if we had a cabinet with two keys and used one of them (`admin`) to get into it. Then, if we later use the other key (`user`) we would see changes.
515+
The example above demonstrates that there is only one object. As if we had a cabinet with two keys and used one of them (`admin`) to get into it. Then, if we later use the other key (`user`) we would see changes.
516516
517517
### Comparison by reference
518518
@@ -539,7 +539,7 @@ let b = {}; // two independent objects
539539
alert( a == b ); // false
540540
```
541541
542-
For comparisons like `obj1 > obj2` or for a comparison against a primitive `obj == 5`, objects are converted to primitives. We'll study how object conversions work very soon, but to say the truth, such comparisons are necessary very rarely and usually are a result of a coding mistake.
542+
For comparisons like `obj1 > obj2` or for a comparison against a primitive `obj == 5`, objects are converted to primitives. We'll study how object conversions work very soon, but to tell the truth, such comparisons are necessary very rarely and usually are a result of a coding mistake.
543543
544544
### Const object
545545
@@ -737,4 +737,4 @@ There are many other kinds of objects in JavaScript:
737737
738738
They have their special features that we'll study later. Sometimes people say something like "Array type" or "Date type", but formally they are not types of their own, but belong to a single "object" data type. And they extend it in various ways.
739739
740-
Objects in JavaScript are very powerful. Here we've just scratched the surface of the topic that is really huge. We'll be closely working with objects and learning more about them in further parts of the tutorial.
740+
Objects in JavaScript are very powerful. Here we've just scratched the surface of a topic that is really huge. We'll be closely working with objects and learning more about them in further parts of the tutorial.

0 commit comments

Comments
 (0)