ECS System in Javascript
I didn't like the strings in the ErrorSystem call, so I factored them out. Comments and additional answers are still welcome.

class Component {
    constructor(data) {
        this.data = data;
    }
} 

class Entity {
    constructor(id) {
        this.id = id;
        this.components = [];
    }

    type(component) {
        return component.prototype === undefined?
            component.constructor.name:
            component.prototype.constructor.name;
    }

    get(component) { return this.components.find(c =&gt; this.type(c) === this.type(component)); }

    set(component) {
        const included = this.get(component);
        if (included === undefined) this.components.push(component);
        else this.components[this.components.indexOf(included)] = component;
    }
}

class System {
    constructor(components, callback) {
        this.components = components;
        this.callback = callback;
    }

    run(entities) {
        entities.forEach(e =&gt; 
            this.components.every(c =&gt; e.get(c) !== undefined) &amp;&amp;
            this.callback(e)
        );
    }
}


class ErrorComponent extends Component {
    constructor(error) {
        super(error);
    }
}

class ErrorSystem extends System {
    constructor() {
        super(
            [ErrorComponent],
            e =&gt; console.error(e.get(ErrorComponent).data)
        );
    }
}

const testComponent = new ErrorComponent("test");

const testEntity = new Entity("test");
testEntity.set(testComponent);

const entities = [testEntity];
const testSystem = new ErrorSystem();
testSystem.run(entities);