title: How does "wrapping" inside objects in JavaScript work exactly?
body: <p>I'm not very comfortable with objects yet and this is my first Stack Overflow question so bear with me. Using the following code,</p>
  
  <pre><code>function wrap(value) {
     return {
       "value": value
     };
  }
  var obj = new wrap("Hello");
  </code></pre>
  
  <p><code>obj.value</code> equals "Hello".</p>
  
  <p>Why does this work? It looks to me as if <code>wrap()</code> is returning an object not associated with the variable <code>obj</code>, so <code>obj.value</code> should not equal <code>Hello</code>.</p>
  
  <p>How is the object that is returned assigned to the variable <code>obj</code>? Does <code>obj</code> automatically equal <code>{"value": value}</code> because it is wrapped inside <code>wrap()</code>?</p>