title: Does JS treat parameter list as a scope that can be closed upon?
body: <p>Looking at this simple code which uses Lazy Expressions: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var x = 1;
  
  function foo(x = 2, f = () =&gt; x) {
    var x = 5;
    console.log(f())
  }
  
  foo()</code></pre>
  </div>
  </div>
  </p>
  
  <p>The output here is <code>2</code>.</p>
  
  <p>I must say that I thought it should output 5. 
  However - this would've been logical if <code>f</code> was closing over the parameter list scope  - if it had a scope.</p>
  
  <p>Because looking at this other example (which a bit related) : </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var x = 5;
  var f = function() {
    return x;
  }
  x = 1
  f();
  console.log(x)</code></pre>
  </div>
  </div>
  </p>
  
  <p>This will output 1. (<em>Which is the expected result</em>.).</p>
  
  <p><strong>Question</strong></p>
  
  <p>What's  actually going here with the parameter list scope ? is there any scope here at all ?(at the parameter list)</p>
  
  <p><em>I didn't find scope related info in the docs.</em></p>