Skip to content

Commit 90f4153

Browse files
committed
Merge branch 'master' of github.com:javascript-tutorial/en.javascript.info into sync-162280b6
2 parents f086d9e + 162280b commit 90f4153

File tree

36 files changed

+123
-73
lines changed

36 files changed

+123
-73
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<body>
5+
6+
<script>
7+
alert( "I'm JavaScript!" );
8+
</script>
9+
10+
</body>
11+
12+
</html>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
[html src="index.html"]

1-js/02-first-steps/11-logical-operators/2-alert-or/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ alert( alert(1) || 2 || alert(3) );
66

77
The call to `alert` does not return a value. Or, in other words, it returns `undefined`.
88

9-
1. The first OR `||` evaluates it's left operand `alert(1)`. That shows the first message with `1`.
9+
1. The first OR `||` evaluates its left operand `alert(1)`. That shows the first message with `1`.
1010
2. The `alert` returns `undefined`, so OR goes on to the second operand searching for a truthy value.
1111
3. The second operand `2` is truthy, so the execution is halted, `2` is returned and then shown by the outer alert.
1212

1-js/02-first-steps/16-arrow-functions-basics/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ let welcome = (age < 18) ?
6767
() => alert('Hello') :
6868
() => alert("Greetings!");
6969
70-
welcome(); // ok now
70+
welcome();
7171
```
7272

7373
Arrow functions may appear unfamiliar and not very readable at first, but that quickly changes as the eyes get used to the structure.

1-js/03-code-quality/03-comments/article.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -125,25 +125,25 @@ Describe the architecture
125125
Document function parameters and usage
126126
: There's a special syntax [JSDoc](http://en.wikipedia.org/wiki/JSDoc) to document a function: usage, parameters, returned value.
127127

128-
For instance:
129-
```js
130-
/**
131-
* Returns x raised to the n-th power.
132-
*
133-
* @param {number} x The number to raise.
134-
* @param {number} n The power, must be a natural number.
135-
* @return {number} x raised to the n-th power.
136-
*/
137-
function pow(x, n) {
138-
...
139-
}
140-
```
128+
For instance:
129+
```js
130+
/**
131+
* Returns x raised to the n-th power.
132+
*
133+
* @param {number} x The number to raise.
134+
* @param {number} n The power, must be a natural number.
135+
* @return {number} x raised to the n-th power.
136+
*/
137+
function pow(x, n) {
138+
...
139+
}
140+
```
141141

142-
Such comments allow us to understand the purpose of the function and use it the right way without looking in its code.
142+
Such comments allow us to understand the purpose of the function and use it the right way without looking in its code.
143143

144-
By the way, many editors like [WebStorm](https://www.jetbrains.com/webstorm/) can understand them as well and use them to provide autocomplete and some automatic code-checking.
144+
By the way, many editors like [WebStorm](https://www.jetbrains.com/webstorm/) can understand them as well and use them to provide autocomplete and some automatic code-checking.
145145

146-
Also, there are tools like [JSDoc 3](https://github.com/jsdoc3/jsdoc) that can generate HTML-documentation from the comments. You can read more information about JSDoc at <http://usejsdoc.org/>.
146+
Also, there are tools like [JSDoc 3](https://github.com/jsdoc3/jsdoc) that can generate HTML-documentation from the comments. You can read more information about JSDoc at <http://usejsdoc.org/>.
147147

148148
Why is the task solved this way?
149149
: What's written is important. But what's *not* written may be even more important to understand what's going on. Why is the task solved exactly this way? The code gives no answer.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ For instance:
215215
function makeUser(name, age) {
216216
return {
217217
name: name,
218-
age: age
218+
age: age,
219219
// ...other properties
220220
};
221221
}
@@ -233,7 +233,7 @@ function makeUser(name, age) {
233233
*!*
234234
return {
235235
name, // same as name: name
236-
age // same as age: age
236+
age, // same as age: age
237237
// ...
238238
};
239239
*/!*

1-js/05-data-types/04-array/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ For stacks, the latest pushed item is received first, that's also called LIFO (L
123123

124124
Arrays in JavaScript can work both as a queue and as a stack. They allow you to add/remove elements both to/from the beginning or the end.
125125

126-
In computer science the data structure that allows it is called [deque](https://en.wikipedia.org/wiki/Double-ended_queue).
126+
In computer science the data structure that allows this, is called [deque](https://en.wikipedia.org/wiki/Double-ended_queue).
127127

128128
**Methods that work with the end of the array:**
129129

1-js/05-data-types/11-date/8-format-date-relative/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ alert( formatDate(new Date(new Date - 30 * 1000)) ); // "30 sec. ago"
4040

4141
alert( formatDate(new Date(new Date - 5 * 60 * 1000)) ); // "5 min. ago"
4242

43-
// yesterday's date like 31.12.2016, 20:00
43+
// yesterday's date like 31.12.2016 20:00
4444
alert( formatDate(new Date(new Date - 86400 * 1000)) );
4545
```
4646

1-js/05-data-types/11-date/8-format-date-relative/task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ alert( formatDate(new Date(new Date - 30 * 1000)) ); // "30 sec. ago"
2020

2121
alert( formatDate(new Date(new Date - 5 * 60 * 1000)) ); // "5 min. ago"
2222

23-
// yesterday's date like 31.12.16, 20:00
23+
// yesterday's date like 31.12.16 20:00
2424
alert( formatDate(new Date(new Date - 86400 * 1000)) );
2525
```

1-js/06-advanced-functions/03-closure/7-let-scope/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function func() {
3131
// hence the error
3232
*/!*
3333

34-
console.log(x); // ReferenceError: Cannot access 'vx before initialization
34+
console.log(x); // ReferenceError: Cannot access 'x' before initialization
3535

3636
let x = 2;
3737
}

0 commit comments

Comments
 (0)