Write Reusable Reporting Functions

Martin Breuss 17 Lessons 3h 34m Updated basics js

Copying a working block of code for every report is how rules drift apart: fix one copy, and the others stay wrong. In this course, you’ll turn a feedback-counting rule into small JavaScript functions that you write once and reuse for any topic and any set of messages.

You’ll work in RealJS exercises the whole way through, with the data and the display supplied. You’ll learn how to:

  • Name a reporting rule as a function and call it with different arguments
  • Pass the topic in and get the matching records back with return
  • Keep each call’s variables to itself so two reports never share a count
  • Build a report result object that keeps the data separate from the display
  • Plan a report as a few small functions and investigate a count that comes out wrong

In the project, you’ll build a topic report that works on two sets of messages, add a function of your own, make a bounded change, and explain to the mentor how it works, message ID by message ID.

What’s Included:

  • 17 Lessons
  • Video Subtitles and Full Transcripts
  • Translated Subtitles in 8 Languages
  • 1 Downloadable Resource
  • Interactive Quiz to Check Your Progress
  • 8 Hands-On Coding Exercises
  • Q&A With JavaScript Experts: Ask a Question
  • Certificate of Completion

Downloadable Resources:

Related Learning Paths:

About Martin Breuss

Martin is Head of Content Strategy at RealJS. He came to programming from biology and has been teaching programming for more than ten years, as a coding mentor, code reviewer, curriculum developer, bootcamp instructor, and instructional designer.

» More about Martin

← Browse All Courses