up
This commit is contained in:
parent
5372c18379
commit
3defacc09d
314 changed files with 1761 additions and 1704 deletions
|
@ -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.
|
20
1-js/8-more-functions/03-closure/3-function-in-if/task.md
Normal file
20
1-js/8-more-functions/03-closure/3-function-in-if/task.md
Normal 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();
|
||||
*/!*
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue