Skip to content

Commit 1ffbae4

Browse files
authored
Update question with more natural phrasing
1 parent e06b519 commit 1ffbae4

File tree

1 file changed

+4
-4
lines changed
  • 1-js/02-first-steps/15-function-expressions-arrows

1 file changed

+4
-4
lines changed

1-js/02-first-steps/15-function-expressions-arrows/article.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ let func = sayHi;
7878
Everything would work the same. Even more obvious what's going on, right?
7979

8080

81-
````smart header="Why there's a semicolon at the end?"
82-
There might be a question, why does Function Expression have a semicolon `;` at the end, and Function Declaration does not:
81+
````smart header="Why is there a semicolon at the end?"
82+
You might wonder, why does Function Expression have a semicolon `;` at the end, but Function Declaration does not:
8383
8484
```js
8585
function sayHi() {
@@ -198,7 +198,7 @@ The more subtle difference is *when* a function is created by the JavaScript eng
198198

199199
**A Function Expression is created when the execution reaches it and is usable from then on.**
200200

201-
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.
201+
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.
202202

203203
Function Declarations are different.
204204

@@ -350,7 +350,7 @@ welcome(); // ok now
350350
```
351351

352352

353-
```smart header="When to choose Function Declaration versus Function Expression?"
353+
```smart header="When should you choose Function Declaration versus Function Expression?"
354354
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.
355355
356356
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".

0 commit comments

Comments
 (0)