You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/04-object-basics/01-object/article.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -224,7 +224,7 @@ That can become a source of bugs and even vulnerabilies if we intent to store ar
224
224
225
225
In that case the visitor may choose "__proto__" as the key, and the assignment logic will be ruined (as shown above).
226
226
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.
228
228
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.
229
229
````
230
230
@@ -368,7 +368,7 @@ Also, we could use another variable name here instead of `key`. For instance, `"
368
368
369
369
### Ordered like an object
370
370
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?
372
372
373
373
The short answer is: "ordered in a special fashion": integer properties are sorted, others appear in creation order. The details follow.
374
374
@@ -512,7 +512,7 @@ admin.name = 'Pete'; // changed by the "admin" reference
512
512
alert(*!*user.name*/!*); //'Pete', changes are seen from the "user" reference
513
513
```
514
514
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.
516
516
517
517
### Comparison by reference
518
518
@@ -539,7 +539,7 @@ let b = {}; // two independent objects
539
539
alert( a == b ); // false
540
540
```
541
541
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.
543
543
544
544
### Const object
545
545
@@ -737,4 +737,4 @@ There are many other kinds of objects in JavaScript:
737
737
738
738
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.
739
739
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