Put everything together! In this final module project you'll build a well-structured dashboard module using clean code organization — separate concerns, reusable functions, and a clear output report.
YOUR TASK
Create a mini sales dashboard that:
Has a data module — an array of at least 5 sales objects with product, revenue, and units
Has a getStats(data) function that returns total revenue, total units, and top product
Has a renderReport(stats) function that prints the dashboard summary cleanly
Keeps all logic separated — data, processing, and display in different functions
Calls renderReport(getStats(salesData)) to run the whole pipeline
Focus on clean code organization — each function does one thing only.
Need a hint?
Structure to follow:
1. const salesData = [ {'{'} product: "...", revenue: 500, units: 10 {'}'}, ... ]
2. function getStats(data) {'{'}
Use .reduce() for total revenue + units
Use .sort() or Math.max to find the top product
Return {'{'} totalRevenue, totalUnits, topProduct {'}'}
3. function renderReport(stats) {'{'}
Log "=== Dashboard ==="
Log each stat on its own line
4. renderReport(getStats(salesData))
Expected output:
=== Sales Dashboard ===
Total Revenue: $3200
Total Units Sold: 87
Top Product: Wireless Headphones
======================
Code Editor Ready
Output
Console
Console initialized...
Ready for Project 5: Mini Dashboard
> Keep your code organized — one function, one job!
> Hit "Check My Code" when ready!