title: javascript new object constructor function alternative proper?
body: <p>Okay, so I've been reading <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new</a>
  And find myself writing a bunch of object construction code in a class sort of scheme.</p>
  
  <p>To maintain backward compatibility I haven't been using 'class' keyword/syntax much.</p>
  
  <p>You may have seen this before:</p>
  
  <pre><code>function Car(make, model, year) {
      this.make = make;
      this.model = model;
      this.year = year;
  }
  //Usage: var carinstance = new Car("blah","blah","blah");
  </code></pre>
  
  <p>But I've found that this works quite well for my use (found by accident):</p>
  
  <pre><code>function Player (name) {
      var p = {
          name : name,
          age : 18
      };
      return p;
  }
  //Usage: var person = new Player("Jon");
  </code></pre>
  
  <p><strong>I know it works</strong>, as I've used it. <strong>I just don't know if this is proper.</strong></p>
  
  <p>For example, I can use the same code w/o 'new' keyword (same result):</p>
  
  <pre><code>var person = Player("Jon");
  </code></pre>
  
  <p>But I cannot do the same with the first specification (using 'this' keyword in a function):</p>
  
  <pre><code>var car = Car("blah","blah","blah"); //car == undefined
  </code></pre>
  
  <p>I don't really know how to google this, or what to call it. I was hard enough trying to figure out what title this question should have.</p>
  
  <p>I guess a more definitive way to put the question:
  Are the results I'm getting just a quark of javascript, browser engine, etc? Or is this a solid way to make a constructor function?</p>