on(event, handler) {
    if (typeof handler !== 'function') {
      throw new TypeError(
        `The handler argument must be of type Function. Received type ${typeof handler}`
      );
    }
    if (!event) {
      throw new TypeError(
        `The event argument must be of type String. Received type ${typeof event}`
      );
    }
    this._handlers.push({
      event,
      handler,
    });

    return this;
  }
/**
   * Adds the event name and handler function to the end of the handlers array.
   * No checks are made to see if the handler has already been added.
   * Multiple calls passing the same combination of event name and handler will result in the handler being added,
   * and called, multiple times.
   * @param {String} event
   * @param {Function} handler
   * @returns {EventEmitter}
   */
Adds the event name and handler function to the end of the handlers array.
No checks are made to see if the handler has already been added.
Multiple calls passing the same combination of event name and handler will result in the handler being added,
and called, multiple times.
@param {String} event
@param {Function} handler
@returns {EventEmitter}
Adds the event name and handler function to the end of the handlers array . No checks are made to see if the handler has already been added . Multiple calls passing the same combination of event name and handler will result in the handler being added and called multiple times . @param { String } event @param { Function } handler @returns { EventEmitter }
on(event, handler) {
    if (typeof handler !== 'function') {
      throw new TypeError(
        `The handler argument must be of type Function. Received type ${typeof handler}`
      );
    }
    if (!event) {
      throw new TypeError(
        `The event argument must be of type String. Received type ${typeof event}`
      );
    }
    this._handlers.push({
      event,
      handler,
    });
    return this;
  }
on ( event , handler ) { if ( typeof handler !== 'function' ) { throw new TypeError ( ` ${ typeof handler } ` ) ; } if ( ! event ) { throw new TypeError ( ` ${ typeof event } ` ) ; } this . _handlers . push ( { event , handler , } ) ; return this ; }
Adds the event name and handler function to the end of the handlers array.
Adds the event name and handler function to the end of the handlers array .