closure
This commit is contained in:
parent
5b195795da
commit
964ed57c42
39 changed files with 365 additions and 461 deletions
|
@ -0,0 +1,20 @@
|
|||
|
||||
# Function in if
|
||||
|
||||
Look at the code. What will be the 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