function(event, fn, id) {
      var self = this;
      var events = self['_on' + event];
      var i = 0;

      // Allow passing just an event and ID.
      if (typeof fn === 'number') {
        id = fn;
        fn = null;
      }

      if (fn || id) {
        // Loop through event store and remove the passed function.
        for (i=0; i<events.length; i++) {
          var isId = (id === events[i].id);
          if (fn === events[i].fn && isId || !fn && isId) {
            events.splice(i, 1);
            break;
          }
        }
      } else if (event) {
        // Clear out all events of this type.
        self['_on' + event] = [];
      } else {
        // Clear out all events of every type.
        var keys = Object.keys(self);
        for (i=0; i<keys.length; i++) {
          if ((keys[i].indexOf('_on') === 0) && Array.isArray(self[keys[i]])) {
            self[keys[i]] = [];
          }
        }
      }

      return self;
    }
function(event, fn, id) {
      var self = this;
      var events = self['_on' + event];
      var i = 0;

      // Allow passing just an event and ID.
      if (typeof fn === 'number') {
        id = fn;
        fn = null;
      }

      if (fn || id) {
        // Loop through event store and remove the passed function.
        for (i=0; i<events.length; i++) {
          var isId = (id === events[i].id);
          if (fn === events[i].fn && isId || !fn && isId) {
            events.splice(i, 1);
            break;
          }
        }
      } else if (event) {
        // Clear out all events of this type.
        self['_on' + event] = [];
      } else {
        // Clear out all events of every type.
        var keys = Object.keys(self);
        for (i=0; i<keys.length; i++) {
          if ((keys[i].indexOf('_on') === 0) && Array.isArray(self[keys[i]])) {
            self[keys[i]] = [];
          }
        }
      }

      return self;
    }
function ( event , fn , id ) { var self = this ; var events = self [ '_on' + event ] ; var i = 0 ; // Allow passing just an event and ID. if ( typeof fn === 'number' ) { id = fn ; fn = null ; } if ( fn || id ) { // Loop through event store and remove the passed function. for ( i = 0 ; i < events . length ; i ++ ) { var isId = ( id === events [ i ] . id ) ; if ( fn === events [ i ] . fn && isId || ! fn && isId ) { events . splice ( i , 1 ) ; break ; } } } else if ( event ) { // Clear out all events of this type. self [ '_on' + event ] = [ ] ; } else { // Clear out all events of every type. var keys = Object . keys ( self ) ; for ( i = 0 ; i < keys . length ; i ++ ) { if ( ( keys [ i ] . indexOf ( '_on' ) === 0 ) && Array . isArray ( self [ keys [ i ] ] ) ) { self [ keys [ i ] ] = [ ] ; } } } return self ; }
Remove a custom event. Call without parameters to remove all events.
@param  {String}   event Event name.
@param  {Function} fn    Listener to remove. Leave empty to remove all.
@param  {Number}   id    (optional) Only remove events for this sound.
@return {Howl}
Remove a custom event . Call without parameters to remove all events .
Remove an event handler