JavaScript + Node.js track

Part 3 · Mini Projects (Workbook)

Todo Filter / Average Calculator

Todo Filter / Average Calculator — Mini Projects (Workbook) in the free JavaScript + Node.js track, covering Higher-order functions, Closure.

Mini Projects (Workbook)1 min readFree lesson

Project brief

Build a todo filter and an average calculator. Both projects are small functional-programming workouts using higher-order functions and closures.

This is a workbook project in the JavaScript track. It has no single prescribed solution: build it in your own file, test it in the browser or Node, and compare your result with the checklist below.

What you will practise

  • Higher-order functions
  • Closure

Build it step by step

  1. Create a list of todo objects with a title and a completed flag.
  2. Write filters for all, active and completed items without changing the source array.
  3. Create a closure-based counter that tracks how many times a calculation is performed.
  4. Use reduce to compute the average of a numeric list, returning null for an empty list.
  5. Print the filtered lists and the average with clear labels.

Stretch goal

Add one feature that is not in the list above, then write down why you chose it and what you had to change. Keep the feature small enough to finish in one sitting.

Before you move on

  • The project runs without errors in a fresh browser tab or Node process.
  • Empty, missing and invalid inputs are handled deliberately.
  • The code is split into small functions with clear names.
  • You can explain every line you wrote.

Topics: Higher-order functions, Closure.

Assignment

Requirements

  • Use filter, map and reduce.
  • Do not use a global variable for the closure counter.
  • Handle non-numeric values in the average input.
  • Keep each function under 20 lines.

Acceptance checklist

  • The happy path works end to end.
  • Invalid input produces a useful message, not a crash.
  • The code is readable and consistently formatted.
  • You have tested at least three different inputs.

Submission

Keep the project in a folder named after the project. Include a short README.md with run instructions and one paragraph describing what was hardest.

Learn this lesson with a mentor

Work through the JavaScript + Node.js track on your own, or join a guided cohort at our Pitampura campus and online.

Call NowEnroll Now