function titlesByAuthorName(authorName, authors, books) {
  // Your code goes here
  let bookArray = [];
  //find array of book ids
  //for each push
  if (!getAuthorByName(authorName, authors)) {
    return [];
  }
  books.forEach((book) => {
    if (getAuthorByName(authorName, authors).books.includes(book.id))
      bookArray.push(book.title);
  });
  return bookArray;
}
/**************************************************************
 * titlesByAuthorName(authorName, authors, books):
 * - receives an authorName
 * - recieves an array of author objects
 * - recieves an array of book objects
 * - returns an array of the titles of the books written by that author:
 *    ["The Hitchhikers Guide", "The Meaning of Liff"]
 ****************************************************************/
titlesByAuthorName(authorName, authors, books):
- receives an authorName
- recieves an array of author objects
- recieves an array of book objects
- returns an array of the titles of the books written by that author:
["The Hitchhikers Guide", "The Meaning of Liff"]
titlesByAuthorName ( authorName authors books ) : - receives an authorName - recieves an array of author objects - recieves an array of book objects - returns an array of the titles of the books written by that author : [ " The Hitchhikers Guide " " The Meaning of Liff " ]
function titlesByAuthorName(authorName, authors, books) {
  let bookArray = [];
  if (!getAuthorByName(authorName, authors)) {
    return [];
  }
  books.forEach((book) => {
    if (getAuthorByName(authorName, authors).books.includes(book.id))
      bookArray.push(book.title);
  });
  return bookArray;
}
function titlesByAuthorName ( authorName , authors , books ) { let bookArray = [ ] ; if ( ! getAuthorByName ( authorName , authors ) ) { return [ ] ; } books . forEach ( ( book ) => { if ( getAuthorByName ( authorName , authors ) . books . includes ( book . id ) ) bookArray . push ( book . title ) ; } ) ; return bookArray ; }
titlesByAuthorName(authorName, authors, books):
 - receives an authorName
 - recieves an array of author objects
 - recieves an array of book objects
 - returns an array of the titles of the books written by that author:
    ["The Hitchhikers Guide", "The Meaning of Liff"]
titlesByAuthorName ( authorName authors books ) : - receives an authorName - recieves an array of author objects - recieves an array of book objects - returns an array of the titles of the books written by that author : [ " The Hitchhikers Guide " " The Meaning of Liff " ]
// Your code goes here //find array of book ids //for each push