Skip to content

Commit 1bb1293

Browse files
committed
2 parents ab40409 + dd88ae4 commit 1bb1293

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

1-js/02-first-steps/08-comparison/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ The same thing with an empty string:
120120
alert( '' == false ); // true
121121
```
122122

123-
That's because operands of different types are converted to a number by the assignment operator `=`. An empty string, just like `false`, becomes a zero.
123+
That's because operands of different types are converted to a number by the equality operator `==`. An empty string, just like `false`, becomes a zero.
124124

125125
What to do if we'd like to differentiate `0` from `false`?
126126

1-js/02-first-steps/09-alert-prompt-confirm/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ We covered 3 browser-specific functions to interact with the visitor:
9696
: shows a message.
9797
9898
`prompt`
99-
: shows a message asking the user to input text. It returns the text or, if CANCEL or `key:Esc` is clicked, all browsers except Safari return `null`.
99+
: shows a message asking the user to input text. It returns the text or, if CANCEL or `key:Esc` is clicked, all browsers return `null`.
100100
101101
`confirm`
102102
: shows a message and waits for the user to press "OK" or "CANCEL". It returns `true` for OK and `false` for CANCEL/`key:Esc`.

1-js/02-first-steps/10-ifelse/article.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Conditional operators: if, '?'
22

3-
Sometimes we need to perform different actions basing on a condition.
3+
Sometimes we need to perform different actions based on a condition.
44

5-
There's an `if` operator for that and also the "question mark" operator: `"?"` for conditional evaluation.
5+
There is `if` statement for that and also the conditional (ternary) operator for conditional evaluation which we will be referring as “question mark operator: `"?"` for simplicity.
66

77
[cut]
88

9-
## The "if" operator
9+
## The "if" statement
1010

11-
The "if" operator gets a condition, evaluates it and -- if the result is `true` -- executes the code.
11+
The "if" statement gets a condition, evaluates it and -- if the result is `true` -- executes the code.
1212

1313
For example:
1414

@@ -22,7 +22,7 @@ if (year == 2015) alert( 'You are right!' );
2222

2323
In the example above, the condition is a simple equality check: `year == 2015`, but it can be much more complex.
2424

25-
If there's more than one command to execute -- we can use a code block in figure brackets:
25+
If there is more than one command to execute -- we can use a code block in figure brackets:
2626

2727
```js
2828
if (year == 2015) {
@@ -31,11 +31,11 @@ if (year == 2015) {
3131
}
3232
```
3333

34-
It is recommended to use figure brackets every time with `if`, even if there's only one command. That improves readability.
34+
It is recommended to use figure brackets every time with `if`, even if there is only one command. That improves readability.
3535

3636
## Boolean conversion
3737

38-
The `if (…)` operator evaluates the expression in parentheses and converts it to the boolean type.
38+
The `if (…)` statement evaluates the expression in parentheses and converts it to the boolean type.
3939

4040
Let's recall the conversion rules from the chapter <info:type-conversions>:
4141

@@ -70,7 +70,7 @@ if (cond) {
7070

7171
## The "else" clause
7272

73-
The `if` operator may contain an optional "else" block. It executes when the condition is wrong.
73+
The `if` statement may contain an optional "else" block. It executes when the condition is wrong.
7474

7575
For example:
7676
```js run
@@ -85,7 +85,7 @@ if (year == 2015) {
8585

8686
## Several conditions: "else if"
8787

88-
Sometimes we'd like to test several variants of a condition. There's an `else if` clause for that.
88+
Sometimes we'd like to test several variants of a condition. There is an `else if` clause for that.
8989

9090
For example:
9191

@@ -220,7 +220,7 @@ We don't assign a result to a variable here, the idea is to execute different co
220220

221221
The notation seem to be shorter than `if`, that appeals to some programmers. But it is less readable.
222222

223-
Here's the same with `if` for comparison:
223+
Here is the same with `if` for comparison:
224224

225225
```js run no-beautify
226226
let company = prompt('Which company created JavaScript?', '');
@@ -236,4 +236,4 @@ if (company == 'Netscape') {
236236

237237
Our eyes scan the code vertically. The constructs which span several lines are easier to understand than a long horizontal instruction set.
238238

239-
The idea of a question mark `'?'` is to return one or another value depending on the condition. Please use it for exactly that. There's `if` to execute different branches of the code.
239+
The idea of a question mark `'?'` is to return one or another value depending on the condition. Please use it for exactly that. There is `if` to execute different branches of the code.

1-js/07-object-oriented-programming/08-class-patterns/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Right now they are fully independent.
182182

183183
But we'd want `Rabbit` to extend `Animal`. In other words, rabbits should be based on animals, have access to methods of `Animal` and extend them with its own methods.
184184

185-
What does it mean in the language on prototypes?
185+
What does it mean in the language of prototypes?
186186

187187
Right now methods for `rabbit` objects are in `Rabbit.prototype`. We'd like `rabbit` to use `Animal.prototype` as a "fallback", if the method is not found in `Rabbit.prototype`.
188188

0 commit comments

Comments
 (0)