title: Javascript classes vs objects, pros and cons?
body: <p>In my most recent javascript program (which is mostly for fun and proof-of-concept than anything else) I have a lot of different kinds of objects and of each kind I'd have a fair amount of "instances". So I was thinking I should use classes for these, however since they are very simple I could simply construct them directly instead of using classes...</p>
  
  <p>Example of what I mean:</p>
  
  <pre><code>//I'm making a "car" object that has the properties model, miles, value and color
  //using a class like:
  function car (model, miles, value, color) { .... }
  //so I'd create a new car by using:
  mycar = new car(model, miles, value, color);
  
  //However for an object so simple I could also do:
  mycar = {model: model, miles: miles, value: value, color: color};
  </code></pre>
  
  <p>I'm guessing the latter method would be more efficient in some way (no call to the class's function), but is it worth it?</p>
  
  <p>To decide that I'd like to know about pros and cons of using classes vs using regular objects. Like do classes take up significantly more memory for example?</p>