title: are anonymous functions dynamically scoped?
body: <p>I read in Java also that anonymous functions introduces a new scope within the enclosing function whereas lambda expressions are block-local.Does it mean the above.I am confused with the following example:</p>
  
  <pre><code>var timer = {
      seconds: 0,
      start() {
          setInterval(() =&gt; {
              this.seconds++
          }, 1000)
      }
  }
  // When an item is searched, it starts from the anonymous function
  // and this doesn't mean the same as parent this.
  // This means that we can access this .seconds by first going to
  // its enclosing function in the arrow expression.
  timer.start()
  
  setTimeout(function () {
      console.log(timer.seconds)
  }, 3500)
  </code></pre>
  
  <p>Here this.seconds will introduce a new scope of this in the enclosing function if it is an anonymous function.Am I right?
  <a href="https://stackoverflow.com/questions/22394089/static-lexical-scoping-vs-dynamic-scoping-pseudocode">Static (Lexical) Scoping vs Dynamic Scoping (Pseudocode)</a></p>