function mostProlificAuthor(authors) {
  // Your code goes here
  let max = 0;
  let bestOne;
  bookCountsByAuthor(authors).forEach((authorObj) => {
    if (authorObj.bookCount > max) {
      max = authorObj.bookCount;
      bestOne = authorObj;
      // bestOne = authorObj.author;
    }
  });
  return bestOne.author;
}
/**************************************************************
 * mostProlificAuthor(authors):
 * - receives a list of authors
 * - returns the name of the author with the most books
 *
 * Note: assume there will never be a tie
 ****************************************************************/
- receives a list of authors
- returns the name of the author with the most books

assume there will never be a tie
- receives a list of authors - returns the name of the author with the most books assume there will never be a tie
function mostProlificAuthor(authors) {
  let max = 0;
  let bestOne;
  bookCountsByAuthor(authors).forEach((authorObj) => {
    if (authorObj.bookCount > max) {
      max = authorObj.bookCount;
      bestOne = authorObj;
    }
  });
  return bestOne.author;
}
function mostProlificAuthor ( authors ) { let max = 0 ; let bestOne ; bookCountsByAuthor ( authors ) . forEach ( ( authorObj ) => { if ( authorObj . bookCount > max ) { max = authorObj . bookCount ; bestOne = authorObj ; } } ) ; return bestOne . author ; }
mostProlificAuthor(authors):
 - receives a list of authors
 - returns the name of the author with the most books
mostProlificAuthor ( authors ) : - receives a list of authors - returns the name of the author with the most books
// Your code goes here // bestOne = authorObj.author;