Reuse Your Report on New Data (Summary)

Congratulations, you made it to the end of the course! Your report started as a few functions inside exercises. Now it runs from your own project folder on any batch that follows the record contract (id, date, text, and label) and uses the current labels, with answers you can explain record by record.

What You Can Do Now

  • Reuse your functions on a new batch: makeReport() in report.js receives an array of records from the supplied loader and returns an object for the supplied display. You don’t need to edit the answers.
  • Apply explicit data rules: Each rule is a small, checked function:
    • selectPending() lists records whose label is null: pending, with no label decided yet.
    • checkRequired() excludes a record with a missing date or text, an empty text field, or a label that’s undefined, applying the rules in order.
    • ignoreExactDuplicates() keeps the first copy of a message and ignores later ones with the same date, label, and text.
  • Explain counted, pending, and excluded records: With the current labels, every record lands in exactly one place, and each exclusion carries an ID and a reason you can check in the source.

The Shape of Your Report

Required values first, then duplicates among the complete records, then counts from what passed both:

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.