From 3ffa0beab057acce68141830ddae3249721f086b Mon Sep 17 00:00:00 2001 From: Violet Bora Lee Date: Sun, 3 Nov 2019 22:14:28 +0900 Subject: [PATCH] minor fixes --- 1-js/02-first-steps/12-while-for/article.md | 2 +- 1-js/05-data-types/06-iterable/article.md | 6 ++++-- 1-js/09-classes/02-class-inheritance/article.md | 2 +- 1-js/11-async/07-microtask-queue/article.md | 2 +- 1-js/99-js-misc/01-proxy/article.md | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/1-js/02-first-steps/12-while-for/article.md b/1-js/02-first-steps/12-while-for/article.md index 580ac3e1..382adada 100644 --- a/1-js/02-first-steps/12-while-for/article.md +++ b/1-js/02-first-steps/12-while-for/article.md @@ -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: -```js +```js run let sum = 0; while (true) { diff --git a/1-js/05-data-types/06-iterable/article.md b/1-js/05-data-types/06-iterable/article.md index 80f067ca..c4f85bb7 100644 --- a/1-js/05-data-types/06-iterable/article.md +++ b/1-js/05-data-types/06-iterable/article.md @@ -142,7 +142,7 @@ for (let char of str) { 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 let str = "Hello"; @@ -150,7 +150,9 @@ let str = "Hello"; // does the same as // for (let char of str) alert(char); +*!* let iterator = str[Symbol.iterator](); +*/!* while (true) { let result = iterator.next(); @@ -268,7 +270,7 @@ for (let char of str) { alert(chars); ``` -...But is shorter. +...But it is shorter. We can even build surrogate-aware `slice` on it: diff --git a/1-js/09-classes/02-class-inheritance/article.md b/1-js/09-classes/02-class-inheritance/article.md index 1000fdd8..d517c90a 100644 --- a/1-js/09-classes/02-class-inheritance/article.md +++ b/1-js/09-classes/02-class-inheritance/article.md @@ -40,7 +40,7 @@ The syntax to extend another class is: `class Child extends Parent`. Let's create `class Rabbit` that inherits from `Animal`: -```js +```js run *!* class Rabbit extends Animal { */!* diff --git a/1-js/11-async/07-microtask-queue/article.md b/1-js/11-async/07-microtask-queue/article.md index 79fc144d..7691ba3b 100644 --- a/1-js/11-async/07-microtask-queue/article.md +++ b/1-js/11-async/07-microtask-queue/article.md @@ -56,7 +56,7 @@ Now the order is as intended. Remember the `unhandledrejection` event from the chapter ? -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.** diff --git a/1-js/99-js-misc/01-proxy/article.md b/1-js/99-js-misc/01-proxy/article.md index a017a960..2ea5ce6f 100644 --- a/1-js/99-js-misc/01-proxy/article.md +++ b/1-js/99-js-misc/01-proxy/article.md @@ -310,7 +310,7 @@ user = new Proxy(user, { return { enumerable: true, configurable: true - /* ...other flags, probable "value:..."" */ + /* ...other flags, probable "value:..." */ }; }