program 4/naiveBayes.js
/**
  * When the last one is read, emit a custom event
  */
When the last one is read, emit a custom event
When the last one is read emit a custom event
function readFileContents(err, data, callback) {
    if (err) throw err;
    callback(data);
    if (--fileCount === 0) {
      events.emit('fileProcessingFinished');
    };
    return;
  }
function readFileContents ( err , data , callback ) { if ( err ) throw err ; callback ( data ) ; if ( -- fileCount === 0 ) { events . emit ( 'fileProcessingFinished' ) ; } ; return ; }
When the last one is read, emit a custom event
When the last one is read emit a custom event