This commit is contained in:
Ilya Kantor 2016-11-12 19:38:58 +03:00
parent 5372c18379
commit 3defacc09d
314 changed files with 1761 additions and 1704 deletions

View file

@ -0,0 +1,3 @@
The result is **an error**.
The function `sayHi` is declared inside the `if`, so it only lives inside it. There is no `sayHi` outside.

View file

@ -0,0 +1,20 @@
# Function in if
Look at the code. What will be result of the call at the last line?
```js run
let phrase = "Hello";
if (true) {
let user = "John";
function sayHi() {
alert(`${phrase}, ${user}`);
}
}
*!*
sayHi();
*/!*
```