Project: The Book Club's Year-End Report

In the last exercise, your grouping and summary functions handled Luis’s empty list, the books with no review, and Dev’s rating of 0. That was the final new piece. You’ve now built every part of the Riverside Book Club’s year-end report in a lesson, and this project puts those parts together into one report.

In this project, you’ll read the club’s brief, see the full report you’re aiming for, and follow a plan of steps that the next two exercises grade. You’ll know what every line of the report should say before you write any code. Like every lesson in this course, this one starts with the shape of the data.

Sketch the Log’s Shape

You’ll build the report from log, the array of six members you’ve worked with since you first drew the log. Here it is again, one level per line, with the parts that can be missing marked:

log: array of 6 member objects
  [i] { name, books }
    books: array of book objects (Luis: [])
      [j] { title, author, genre, rating, review? }
            rating: 0 to 5 (Dev's Circe: 0)
            review: only on some books

Each member and each book is a record, a plain object with named keys, and three details in this sketch matter for the report. Luis’s books is an empty array, so any step that reads a member’s first or best book has to cope with nothing. Some books have no review key at all. And Dev’s rating of 0 is a real rating, not a missing one.

Most of the report asks about the whole club, not one member. For those parts, you’ll work on allBooks, the flat list you built by pushing each book, one at a time, in a nested loop:

allBooks: array of 15 book objects
  [k] { title, author, genre, rating, review? }

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.