title: When I declare a variable inside a function, which object is it a property of?
body: <p>So when I declare a variable outside the scope of any function, it becomes a property of the window object. But what about when I declare a variable inside the scope of a function? For example, in the following code I can treat x as a property of window, i.e., window.x, but what about y? Is it ever the property of an object?</p>
  
  <pre><code>var x = "asdf1";
  
  function test() {
  var y = "asdf2";
  }
  
  test();
  </code></pre>