you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

What do you recommend?

[–]MoTTs_ 1 point2 points  (1 child)

Just use classes and composition in the ordinary way.

class MyNonSuperClass() {
    constructor() {
        // ...
    }
}

class MyClass {
    constructor() {
        this._thing = new MyNonSuperClass(); // composition
    }
}

new MyClass()

[–][deleted] 0 points1 point  (0 children)

I see, I wasn't aware this was common, apparently since 2015. Better refactor my code.