closure and scope javascript

Solutions on MaxInterview for closure and scope javascript by the best coders in the world

showing results for - "closure and scope javascript"
Gaétan
19 Mar 2018
1function outerFunction () {
2  const outer = `I'm the outer function!`
3
4  function innerFunction() {
5    const inner = `I'm the inner function!`
6    console.log(outer) // I'm the outer function!
7  }
8
9  console.log(inner) // Error, inner is not defined
10}