The more I consider object oriented JavaScript the more I am confused. There are so many different ways and concepts and I simply do not know any longer what fits best for my purposes.I like the constructor pattern but I have the feeling that I've mixed different concepts:Subclass.prototype = Object.create(Superclass.prototype);function Subclass(name, value) {    Superclass.call(this);    this._name = name;    this._value = value;    this._init();}Object.defineProperties(Subclass.prototype, {    'name': {        get: function() { return this._name; }    },    'value': {        get: function() { return this._value; },        set: function(value) { this._value = value; }    }})Subclass.prototype._init = function() {    // some initialization};Subclass.prototype.compute = function() {    var name = this.getName();    var value = this.getName();    // do something with name and value...};Is there a cleaner way?Should one use getters and setters for internal access (like I would do it in other languages)?Edit #1Define properties of prototype (Object.defineProperties(Subclass, {} to Object.defineProperties(Subclass.prototype, {})
Simple JavaScript (sub) class [properties, getters, methods]
javascript;beginner