title: What techniques can be used to define a class in JavaScript, and what are their trade-offs?
body: <p>I prefer to use OOP in large scale projects like the one I'm working on right now. I need to create several classes in JavaScript but, if I'm not mistaken, there are at least a couple of ways to go about doing that. What would be the syntax and why would it be done in that way?</p>
  
  <p>I would like to avoid using third-party libraries - at least at first.<br>
  Looking for other answers, I found the article <em><a href="http://www.webreference.com/js/column79/" rel="noreferrer">Object-Oriented Programming with JavaScript, Part I: Inheritance - Doc JavaScript</a></em> that discusses object-oriented programming in JavaScript. Is there a better way to do inheritance? </p>