minor fixes

This commit is contained in:
Violet Bora Lee 2019-11-03 22:14:28 +09:00
parent 611fefd90e
commit 3ffa0beab0
5 changed files with 8 additions and 6 deletions

View file

@ -212,7 +212,7 @@ But we can force the exit at any time using the special `break` directive.
For example, the loop below asks the user for a series of numbers, "breaking" when no number is entered: For example, the loop below asks the user for a series of numbers, "breaking" when no number is entered:
```js ```js run
let sum = 0; let sum = 0;
while (true) { while (true) {

View file

@ -142,7 +142,7 @@ for (let char of str) {
For deeper understanding let's see how to use an iterator explicitly. For deeper understanding let's see how to use an iterator explicitly.
We'll iterate over a string in exactlly the same way as `for..of`, but with direct calls. This code creates a string iterator and gets values from it "manually": We'll iterate over a string in exactly the same way as `for..of`, but with direct calls. This code creates a string iterator and gets values from it "manually":
```js run ```js run
let str = "Hello"; let str = "Hello";
@ -150,7 +150,9 @@ let str = "Hello";
// does the same as // does the same as
// for (let char of str) alert(char); // for (let char of str) alert(char);
*!*
let iterator = str[Symbol.iterator](); let iterator = str[Symbol.iterator]();
*/!*
while (true) { while (true) {
let result = iterator.next(); let result = iterator.next();
@ -268,7 +270,7 @@ for (let char of str) {
alert(chars); alert(chars);
``` ```
...But is shorter. ...But it is shorter.
We can even build surrogate-aware `slice` on it: We can even build surrogate-aware `slice` on it:

View file

@ -40,7 +40,7 @@ The syntax to extend another class is: `class Child extends Parent`.
Let's create `class Rabbit` that inherits from `Animal`: Let's create `class Rabbit` that inherits from `Animal`:
```js ```js run
*!* *!*
class Rabbit extends Animal { class Rabbit extends Animal {
*/!* */!*

View file

@ -56,7 +56,7 @@ Now the order is as intended.
Remember the `unhandledrejection` event from the chapter <info:promise-error-handling>? Remember the `unhandledrejection` event from the chapter <info:promise-error-handling>?
Now we can see exactly how JavaScript finds out that there was an unhandled rejection Now we can see exactly how JavaScript finds out that there was an unhandled rejection.
**"Unhandled rejection" occurs when a promise error is not handled at the end of the microtask queue.** **"Unhandled rejection" occurs when a promise error is not handled at the end of the microtask queue.**

View file

@ -310,7 +310,7 @@ user = new Proxy(user, {
return { return {
enumerable: true, enumerable: true,
configurable: true configurable: true
/* ...other flags, probable "value:..."" */ /* ...other flags, probable "value:..." */
}; };
} }