From 843e5f32b1b1bbd2b4a7e7194704e07d2dbf9d44 Mon Sep 17 00:00:00 2001 From: evazorro Date: Thu, 18 Oct 2018 11:22:48 -0400 Subject: [PATCH 1/4] Grammatical and wording updates --- 1-js/02-first-steps/01-hello-world/article.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/1-js/02-first-steps/01-hello-world/article.md b/1-js/02-first-steps/01-hello-world/article.md index 2cb3c65e..7e84e733 100644 --- a/1-js/02-first-steps/01-hello-world/article.md +++ b/1-js/02-first-steps/01-hello-world/article.md @@ -47,10 +47,10 @@ The ` ``` - This trick isn't used in modern JavaScript. These comments were used to hide the JavaScript code from old browsers that didn't know about a ` From 8c31fae9fa4c518e87af2cc78bea1354e00054de Mon Sep 17 00:00:00 2001 From: evazorro Date: Thu, 18 Oct 2018 11:27:08 -0400 Subject: [PATCH 2/4] Make "parental permissions" prompt sound more natural --- 1-js/02-first-steps/14-function-basics/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/14-function-basics/article.md b/1-js/02-first-steps/14-function-basics/article.md index 9f405128..5987569c 100644 --- a/1-js/02-first-steps/14-function-basics/article.md +++ b/1-js/02-first-steps/14-function-basics/article.md @@ -263,7 +263,7 @@ function checkAge(age) { */!* } else { *!* - return confirm('Got a permission from the parents?'); + return confirm('Do you have permission from your parents?'); */!* } } From e06b51996ab9aa5002716cba60666d6302f6ad9f Mon Sep 17 00:00:00 2001 From: evazorro Date: Thu, 18 Oct 2018 11:41:34 -0400 Subject: [PATCH 3/4] Reword "clue" sentence This sounds more natural and professional --- 1-js/02-first-steps/14-function-basics/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/14-function-basics/article.md b/1-js/02-first-steps/14-function-basics/article.md index 5987569c..e301d776 100644 --- a/1-js/02-first-steps/14-function-basics/article.md +++ b/1-js/02-first-steps/14-function-basics/article.md @@ -334,7 +334,7 @@ So, it effectively becomes an empty return. We should put the value on the same ## Naming a function [#function-naming] -Functions are actions. So their name is usually a verb. It should briefly, but as accurately as possible describe what the function does. So that a person who reads the code gets the right clue. +Functions are actions. So their name is usually a verb. It should briefly, but as accurately as possible, describe what the function does, so that someone reading the code gets an indication of what the function does. It is a widespread practice to start a function with a verbal prefix which vaguely describes the action. There must be an agreement within the team on the meaning of the prefixes. From 1ffbae42fa13cac5554fa85e8e15f2b1c6219c97 Mon Sep 17 00:00:00 2001 From: evazorro Date: Thu, 18 Oct 2018 12:24:28 -0400 Subject: [PATCH 4/4] Update question with more natural phrasing --- .../15-function-expressions-arrows/article.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/1-js/02-first-steps/15-function-expressions-arrows/article.md b/1-js/02-first-steps/15-function-expressions-arrows/article.md index 201a1ffe..e6380bd2 100644 --- a/1-js/02-first-steps/15-function-expressions-arrows/article.md +++ b/1-js/02-first-steps/15-function-expressions-arrows/article.md @@ -78,8 +78,8 @@ let func = sayHi; Everything would work the same. Even more obvious what's going on, right? -````smart header="Why there's a semicolon at the end?" -There might be a question, why does Function Expression have a semicolon `;` at the end, and Function Declaration does not: +````smart header="Why is there a semicolon at the end?" +You might wonder, why does Function Expression have a semicolon `;` at the end, but Function Declaration does not: ```js function sayHi() { @@ -198,7 +198,7 @@ The more subtle difference is *when* a function is created by the JavaScript eng **A Function Expression is created when the execution reaches it and is usable from then on.** -Once the execution flow passes to the right side of the assignment `let sum = function…` -- here we go, the function is created and can be used (assigned, called etc) from now on. +Once the execution flow passes to the right side of the assignment `let sum = function…` -- here we go, the function is created and can be used (assigned, called, etc. ) from now on. Function Declarations are different. @@ -350,7 +350,7 @@ welcome(); // ok now ``` -```smart header="When to choose Function Declaration versus Function Expression?" +```smart header="When should you choose Function Declaration versus Function Expression?" As a rule of thumb, when we need to declare a function, the first to consider is Function Declaration syntax, the one we used before. It gives more freedom in how to organize our code, because we can call such functions before they are declared. It's also a little bit easier to look up `function f(…) {…}` in the code than `let f = function(…) {…}`. Function Declarations are more "eye-catching".