Answers for "closure and scope javascript"

0

closure and scope javascript

function outerFunction () {
  const outer = `I'm the outer function!`

  function innerFunction() {
    const inner = `I'm the inner function!`
    console.log(outer) // I'm the outer function!
  }

  console.log(inner) // Error, inner is not defined
}
Posted by: Guest on April-06-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language