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-5
Original file line number
Diff line number
Diff line change
@@ -226,7 +226,7 @@ That can become a source of bugs and even vulnerabilies if we intent to store ar
226
226
227
227
In that case the visitor may choose "__proto__" as the key, and the assignment logic will be ruined (as shown above).
228
228
229
-
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.
229
+
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.
230
230
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.
231
231
````
232
232
@@ -370,7 +370,7 @@ Also, we could use another variable name here instead of `key`. For instance, `"
370
370
371
371
### Ordered like an object
372
372
373
-
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?
373
+
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?
374
374
375
375
The short answer is: "ordered in a special fashion": integer properties are sorted, others appear in creation order. The details follow.
376
376
@@ -514,7 +514,7 @@ admin.name = 'Pete'; // changed by the "admin" reference
514
514
alert(*!*user.name*/!*); //'Pete', changes are seen from the "user" reference
515
515
```
516
516
517
-
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.
517
+
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.
518
518
519
519
### Comparison by reference
520
520
@@ -541,7 +541,7 @@ let b = {}; // two independent objects
541
541
alert( a == b ); // false
542
542
```
543
543
544
-
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.
544
+
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.
545
545
546
546
### Const object
547
547
@@ -739,4 +739,4 @@ There are many other kinds of objects in JavaScript:
739
739
740
740
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.
741
741
742
-
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.
742
+
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