HomeChallengesRepsProblemsLeaderboardTake a challenge

Product Catalog

Five lookups over a product list. This is map, filter, find and reduce, and nothing else.

Beginner10 min on the clock6 graded checks · 100 pointsJavaScript + TypeScript
Graded by running your code against real cases.

What you build

  • getProductById(id) — the product, or undefined if there is none
  • getProductsByCategory(category) — every product in that category
  • getProductsAbovePrice(price) — strictly above, not equal
  • getTotalInventoryValue() — the sum of every price
  • getMostExpensiveProduct() — the single dearest product

Done means

Every function returns the right value, including for inputs that match nothing.

How it is graded

Published in full, before you start — every point is one of these and there is nothing else. Each one runs your code; it is not a search for keywords.

  1. getProductById finds one, and copes with a miss+20Array methods
  2. getProductsByCategory returns every match+20Array methods
  3. getProductsAbovePrice excludes the boundary+15Array methods
  4. getTotalInventoryValue sums with reduce+20Array methods
  5. getMostExpensiveProduct picks the dearest+15Array methods
  6. None of them reorder the original list+10Not mutating your inputs

What it teaches

The rest of JavaScript + TypeScript