Skip to content

Commit bd40615

Browse files
committed
# Conflicts: # 1-js/02-first-steps/04-variables/article.md # 1-js/07-object-properties/01-property-descriptors/article.md # 2-ui/1-document/04-searching-elements-dom/article.md
2 parents 90679b5 + 4d65431 commit bd40615

28 files changed

Lines changed: 231 additions & 237 deletions

File tree

1-js/04-object-basics/04-object-methods/2-check-syntax/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let user = {
1111
(user.go)() // error!
1212
```
1313

14-
The error message in most browsers does not give understanding what went wrong.
14+
The error message in most browsers does not give us much of a clue about what went wrong.
1515

1616
**The error appears because a semicolon is missing after `user = {...}`.**
1717

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ user.sayHi(); // Hello!
6161
```
6262

6363
```smart header="Object-oriented programming"
64-
When we write our code using objects to represent entities, that's called an [object-oriented programming](https://en.wikipedia.org/wiki/Object-oriented_programming), in short: "OOP".
64+
When we write our code using objects to represent entities, that's called [object-oriented programming](https://en.wikipedia.org/wiki/Object-oriented_programming), in short: "OOP".
6565
6666
OOP is a big thing, an interesting science of its own. How to choose the right entities? How to organize the interaction between them? That's architecture, and there are great books on that topic, like "Design Patterns: Elements of Reusable Object-Oriented Software" by E.Gamma, R.Helm, R.Johnson, J.Vissides or "Object-Oriented Analysis and Design with Applications" by G.Booch, and more.
6767
```
@@ -228,9 +228,9 @@ If you come from another programming language, then you are probably used to the
228228
229229
In JavaScript `this` is "free", its value is evaluated at call-time and does not depend on where the method was declared, but rather on what object is "before the dot".
230230
231-
The concept of run-time evaluated `this` has both pluses and minuses. On the one hand, a function can be reused for different objects. On the other hand, greater flexibility opens a place for mistakes.
231+
The concept of run-time evaluated `this` has both pluses and minuses. On the one hand, a function can be reused for different objects. On the other hand, the greater flexibility creates more possibilities for mistakes.
232232
233-
Here our position is not to judge whether this language design decision is good or bad. We'll understand how to work with it, how to get benefits and evade problems.
233+
Here our position is not to judge whether this language design decision is good or bad. We'll understand how to work with it, how to get benefits and avoid problems.
234234
```
235235
236236
## Internals: Reference Type

1-js/04-object-basics/06-constructor-new/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Usually, constructors do not have a `return` statement. Their task is to write a
134134

135135
But if there is a `return` statement, then the rule is simple:
136136

137-
- If `return` is called with object, then it is returned instead of `this`.
137+
- If `return` is called with an object, then the object is returned instead of `this`.
138138
- If `return` is called with a primitive, it's ignored.
139139

140140
In other words, `return` with an object returns that object, in all other cases `this` is returned.

1-js/06-advanced-functions/06-function-object/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ Now it works, because the name `"func"` is function-local. It is not taken from
329329
The outer code still has it's variable `sayHi` or `welcome`. And `func` is an "internal function name", how the function can call itself internally.
330330

331331
```smart header="There's no such thing for Function Declaration"
332-
The "internal name" feature described here is only available for Function Expressions, not to Function Declarations. For Function Declarations, there's just no syntax possibility to add a one more "internal" name.
332+
The "internal name" feature described here is only available for Function Expressions, not for Function Declarations. For Function Declarations, there is no syntax for adding an "internal" name.
333333
334334
Sometimes, when we need a reliable internal name, it's the reason to rewrite a Function Declaration to Named Function Expression form.
335335
```

1-js/06-advanced-functions/10-bind/4-function-property-after-bind/task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ importance: 5
44

55
# Function property after bind
66

7-
There's a value in the property of a function. Will it change after `bind`? Why, elaborate?
7+
There's a value in the property of a function. Will it change after `bind`? Why, or why not?
88

99
```js run
1010
function sayHi() {

1-js/06-advanced-functions/10-bind/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ alert( triple(5) ); // = mul(3, 5) = 15
258258
259259
Why do we usually make a partial function?
260260
261-
The benefit is that we can create an independent function with a readable name (`double`, `triple`). We can use it and not provide first argument of every time as it's fixed with `bind`.
261+
The benefit is that we can create an independent function with a readable name (`double`, `triple`). We can use it and not provide the first argument every time as it's fixed with `bind`.
262262
263263
In other cases, partial application is useful when we have a very generic function and want a less universal variant of it for convenience.
264264

1-js/06-advanced-functions/12-arrow-functions/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Let's revisit arrow functions.
44

55
Arrow functions are not just a "shorthand" for writing small stuff. They have some very specific and useful features.
66

7-
JavaScript is full of situations where we need to write a small function, that's executed somewhere else.
7+
JavaScript is full of situations where we need to write a small function that's executed somewhere else.
88

99
For instance:
1010

1-js/07-object-properties/01-property-descriptors/article.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
As we know, objects can store properties.
55

6-
Till now, a property was a simple "key-value" pair to us. But an object property is actually a more complex and tunable thing.
6+
Till now, a property was a simple "key-value" pair to us. But an object property is actually a more flexible and powerful thing.
7+
8+
In this chapter we'll study additional configuration options, and in the next we'll see how to invisibly turn them into getter/setter functions.
79

810
## Property flags
911

@@ -307,13 +309,13 @@ Property descriptors work at the level of individual properties.
307309
There are also methods that limit access to the *whole* object:
308310

309311
[Object.preventExtensions(obj)](mdn:js/Object/preventExtensions)
310-
: Forbids to add properties to the object.
312+
: Forbids the addition of new properties to the object.
311313

312314
[Object.seal(obj)](mdn:js/Object/seal)
313-
: Forbids to add/remove properties, sets for all existing properties `configurable: false`.
315+
: Forbids adding/removing of properties. Sets `configurable: false` for all existing properties.
314316

315317
[Object.freeze(obj)](mdn:js/Object/freeze)
316-
: Forbids to add/remove/change properties, sets for all existing properties `configurable: false, writable: false`.
318+
: Forbids adding/removing/changing of properties. Sets `configurable: false, writable: false` for all existing properties.
317319

318320
And also there are tests for them:
319321

1-js/07-object-properties/02-property-accessors/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The getter works when `obj.propName` is read, the setter -- when it is assigned.
2727

2828
For instance, we have a `user` object with `name` and `surname`:
2929

30-
```js run
30+
```js
3131
let user = {
3232
name: "John",
3333
surname: "Smith"
@@ -102,9 +102,9 @@ There's no similar method to handle deletion of an accessor property. Only gette
102102
103103
## Accessor descriptors
104104
105-
Descriptors for accessor properties are different -- as compared with data properties.
105+
Descriptors for accessor properties are different from those for data properties.
106106
107-
For accessor properties, there is no `value` and `writable`, but instead there are `get` and `set` functions.
107+
For accessor properties, there is no `value` or `writable`, but instead there are `get` and `set` functions.
108108
109109
That is, an accessor descriptor may have:
110110

1-js/08-prototypes/01-prototype-inheritance/4-hamster-proto/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ alert( lazy.stomach ); // <nothing>
4444

4545
Now all works fine, because `this.stomach=` does not perform a lookup of `stomach`. The value is written directly into `this` object.
4646

47-
Also we can totally evade the problem by making sure that each hamster has their own stomach:
47+
Also we can totally avoid the problem by making sure that each hamster has their own stomach:
4848

4949
```js run
5050
let hamster = {

0 commit comments

Comments
 (0)