One problem with “this” approach (pun intended) is the memory overhead. Factory patterns, as shown here, return new functions every call, meaning higher memory usage. If you use prototypes instead (and, without being snarky, learn how scope works in JavaScript), you don’t get this additional memory usage as each instance of a type gets it’s methods from it’s prototype. Therefore all instance of a type share a reference to a single object (the prototype). It should be obvious why this is preferable in the general case.
Of course there are some cases where this approach is more appropriate e.g. mixins
One problem with “this” approach (pun intended) is the memory overhead. Factory patterns, as shown here, return new functions every call, meaning higher memory usage. If you use prototypes instead (and, without being snarky, learn how scope works in JavaScript), you don’t get this additional memory usage as each instance of a type gets it’s methods from it’s prototype. Therefore all instance of a type share a reference to a single object (the prototype). It should be obvious why this is preferable in the general case.
Of course there are some cases where this approach is more appropriate e.g. mixins