en.javascript.info/1-js/06-advanced-functions/03-closure/3-function-in-if/task.md
Ilya Kantor ab9ab64bd5 up
2017-03-21 14:41:49 +03:00

238 B

Function in if

Look at the code. What will be result of the call at the last line?

let phrase = "Hello";

if (true) {
  let user = "John";

  function sayHi() {
    alert(`${phrase}, ${user}`);
  }
}

*!*
sayHi();
*/!*