Skip to content

Commit 6eff54a

Browse files
Update article.md
- updated incorrect spellings - Updated the grammar-related errors
1 parent 2cca9a9 commit 6eff54a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ In the `user` object, there are two properties:
4040
1. The first property has the name `"name"` and the value `"John"`.
4141
2. The second one has the name `"age"` and the value `30`.
4242

43-
The resulting `user` object can be imagined as a cabinet with two signed files labeled "name" and "age".
43+
The resulting `user` object can be imagined as a cabinet with two signed files labelled "name" and "age".
4444

4545
![user object](object-user.svg)
4646

47-
We can add, remove and read files from it any time.
47+
We can add, remove and read files from it at any time.
4848

4949
Property values are accessible using the dot notation:
5050

@@ -62,7 +62,7 @@ user.isAdmin = true;
6262

6363
![user object 2](object-user-isadmin.svg)
6464

65-
To remove a property, we can use `delete` operator:
65+
To remove a property, we can use the `delete` operator:
6666

6767
```js
6868
delete user.age;
@@ -120,7 +120,7 @@ alert(user["likes birds"]); // true
120120
delete user["likes birds"];
121121
```
122122

123-
Now everything is fine. Please note that the string inside the brackets is properly quoted (any type of quotes will do).
123+
Now everything is fine. Please note that the string inside the brackets is properly quoted (any type of quote will do).
124124

125125
Square brackets also provide a way to obtain the property name as the result of any expression -- as opposed to a literal string -- like from a variable as follows:
126126

@@ -201,13 +201,13 @@ let bag = {
201201
};
202202
```
203203

204-
Square brackets are much more powerful than the dot notation. They allow any property names and variables. But they are also more cumbersome to write.
204+
Square brackets are much more powerful than dot notation. They allow any property names and variables. But they are also more cumbersome to write.
205205

206206
So most of the time, when property names are known and simple, the dot is used. And if we need something more complex, then we switch to square brackets.
207207

208208
## Property value shorthand
209209

210-
In real code we often use existing variables as values for property names.
210+
In real code, we often use existing variables as values for property names.
211211

212212
For instance:
213213

@@ -252,7 +252,7 @@ let user = {
252252

253253
## Property names limitations
254254

255-
As we already know, a variable cannot have a name equal to one of language-reserved words like "for", "let", "return" etc.
255+
As we already know, a variable cannot have a name equal to one of the language-reserved words like "for", "let", "return" etc.
256256

257257
But for an object property, there's no such restriction:
258258

@@ -325,7 +325,7 @@ alert( "blabla" in user ); // false, user.blabla doesn't exist
325325

326326
Please note that on the left side of `in` there must be a *property name*. That's usually a quoted string.
327327

328-
If we omit quotes, that means a variable, it should contain the actual name to be tested. For instance:
328+
If we omit quotes, that means a variable should contain the actual name to be tested. For instance:
329329

330330
```js run
331331
let user = { age: 30 };
@@ -412,7 +412,7 @@ for (let code in codes) {
412412
*/!*
413413
```
414414
415-
The object may be used to suggest a list of options to the user. If we're making a site mainly for German audience then we probably want `49` to be the first.
415+
The object may be used to suggest a list of options to the user. If we're making a site mainly for a German audience then we probably want `49` to be the first.
416416
417417
But if we run the code, we see a totally different picture:
418418
@@ -481,7 +481,7 @@ They store properties (key-value pairs), where:
481481
482482
To access a property, we can use:
483483
- The dot notation: `obj.property`.
484-
- Square brackets notation `obj["property"]`. Square brackets allow to take the key from a variable, like `obj[varWithKey]`.
484+
- Square brackets notation `obj["property"]`. Square brackets allow taking the key from a variable, like `obj[varWithKey]`.
485485
486486
Additional operators:
487487
- To delete a property: `delete obj.prop`.

0 commit comments

Comments
 (0)