Merge branch 'master' into patch-4

This commit is contained in:
Ilya Kantor 2017-09-03 19:53:02 +03:00 committed by GitHub
commit 7efbc5a677
6 changed files with 8 additions and 8 deletions

View file

@ -101,7 +101,7 @@ Please open the informational dropdowns to the right (labeled with arrows). They
1. **`Watch` -- shows current values for any expressions.**
You can click the plus `+` and input an expression. The debugger will shown its value at any moment, automatically recalculating it in in the process of execution.
You can click the plus `+` and input an expression. The debugger will show its value at any moment, automatically recalculating it in in the process of execution.
2. **`Call Stack` -- shows the nested calls chain.**

View file

@ -236,7 +236,7 @@ alert( str.indexOf("id") ); // 1, "id" is found at the position 1 (..idget with
The optional second parameter allows us to search starting from the given position.
For instance, the first occurence of `"id"` is at position `1`. To look for the next occurence, let's start the search from position `2`:
For instance, the first occurence of `"id"` is at position `1`. To look for the next occurence, let's start the search from position `2`:
```js run
let str = 'Widget with id';
@ -245,7 +245,7 @@ alert( str.indexOf('id', 2) ) // 12
```
If we're interested in all occurences, we can run `indexOf` in a loop. Every new call is made with the position after the previous match:
If we're interested in all occurrences, we can run `indexOf` in a loop. Every new call is made with the position after the previous match:
```js run

View file

@ -1,6 +1,6 @@
```js run
function getAverageAge(users) {
return arr.reduce((prev, user) => prev + user.age, 0) / arr.length;
return users.reduce((prev, user) => prev + user.age, 0) / users.length;
}
let john = { name: "John", age: 25 }