From c8a11f3e865a8ed8e429ae4ff31c8447aed32914 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Wed, 2 Oct 2019 10:36:06 +0300 Subject: [PATCH] minor --- 1-js/05-data-types/10-destructuring-assignment/article.md | 2 +- 1-js/06-advanced-functions/01-recursion/article.md | 8 +++++++- 1-js/09-classes/01-class/article.md | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/1-js/05-data-types/10-destructuring-assignment/article.md b/1-js/05-data-types/10-destructuring-assignment/article.md index c2288847..d069ccf0 100644 --- a/1-js/05-data-types/10-destructuring-assignment/article.md +++ b/1-js/05-data-types/10-destructuring-assignment/article.md @@ -356,7 +356,7 @@ The problem is that JavaScript treats `{...}` in the main code flow (not inside } ``` -So here JavaScript assumes that we have a code block, that's why there's an error. We have destructuring instead. +So here JavaScript assumes that we have a code block, that's why there's an error. We want destructuring instead. To show JavaScript that it's not a code block, we can wrap the expression in parentheses `(...)`: diff --git a/1-js/06-advanced-functions/01-recursion/article.md b/1-js/06-advanced-functions/01-recursion/article.md index 9d217653..3e41d432 100644 --- a/1-js/06-advanced-functions/01-recursion/article.md +++ b/1-js/06-advanced-functions/01-recursion/article.md @@ -185,7 +185,13 @@ Here's the context stack when we entered the subcall `pow(2, 2)`: The new current execution context is on top (and bold), and previous remembered contexts are below. -When we finish the subcall -- it is easy to resume the previous context, because it keeps both variables and the exact place of the code where it stopped. Here in the picture we use the word "line", but of course it's more precise. +When we finish the subcall -- it is easy to resume the previous context, because it keeps both variables and the exact place of the code where it stopped. + +```smart +Here in the picture we use the word "line", as our example there's only one subcall in line, but generally a single line of code may contain multiple subcalls, like `pow(…) + pow(…) + somethingElse(…)`. + +So it would be more precise to say that the execution resumes "immediately after the subcall". +``` ### pow(2, 1) diff --git a/1-js/09-classes/01-class/article.md b/1-js/09-classes/01-class/article.md index e924d365..b20761ec 100644 --- a/1-js/09-classes/01-class/article.md +++ b/1-js/09-classes/01-class/article.md @@ -89,7 +89,7 @@ What `class User {...}` construct really does is: 1. Creates a function named `User`, that becomes the result of the class declaration. The function code is taken from the `constructor` method (assumed empty if we don't write such method). 2. Stores class methods, such as `sayHi`, in `User.prototype`. -Afterwards, for `new User` objects, when we call a method, it's taken from the prototype, just as described in the chapter . So the object has access to class methods. +After `new User` object is created, when we call its method, it's taken from the prototype, just as described in the chapter . So the object has access to class methods. We can illustrate the result of `class User` declaration as: