If statement behaving like for loop

#1

I have an event listener that is supposed to call an alert method if a given value is >1:
But I get multiple popups simultaneously, why is that the case.

    this.events.subscribe("books-count", out => {
      let keyz = Object.keys(out);
      if (keyz.length > 1) {
        //this.alertMe();
        return this.alertMe();
      }
    });

I previously said that the problem is solved with use of return statement. Actually it wasn’t solved. Does anyone know what could probably cause multiple popups. The event is only once declared and once subscribed.