Fix name of JavaScript

This commit is contained in:
Alexey Pyltsyn 2019-04-23 11:51:28 +03:00
parent 3b14ed8185
commit c5ce5578fc
32 changed files with 61 additions and 61 deletions

View file

@ -221,7 +221,7 @@ function sayHiBye(firstName, lastName) {
}
```
Here the *nested* function `getFullName()` is made for convenience. It can access the outer variables and so can return the full name. Nested functions are quite common in Javascript.
Here the *nested* function `getFullName()` is made for convenience. It can access the outer variables and so can return the full name. Nested functions are quite common in JavaScript.
What's much more interesting, a nested function can be returned: either as a property of a new object (if the outer function creates an object with methods) or as a result by itself. It can then be used somewhere else. No matter where, it still has access to the same outer variables.
@ -473,7 +473,7 @@ The code outside of the block (or inside another script) doesn't see variables i
### IIFE
In the past, there were no block-level lexical environment in Javascript.
In the past, there were no block-level lexical environment in JavaScript.
So programmers had to invent something. And what they did is called "immediately-invoked function expressions" (abbreviated as IIFE).

View file

@ -79,7 +79,7 @@ No, it's not, because it may lead to naming conflicts: the same variable name ca
As of now, the multi-purpose `window` is considered a design mistake in the language.
Luckily, there's a "road out of hell", called "Javascript modules".
Luckily, there's a "road out of hell", called "JavaScript modules".
If we set `type="module"` attribute on a `<script>` tag, then such script is considered a separate "module" with its own top-level scope (lexical environment), not interfering with `window`.