Ad
  • Custom User Avatar

    Is it an actual best practice?

    By adding a method directly into a constructor, the method is copied every time you create a new instance.
    That's why it's better to add it using

    Ship.prototype.isWorthIt = function(){}

    outside the constructor, or by using ES6 classes.