← Practice
Objects·hard 30 min 120 XP

Inventory Calculator

Given an array of { name, price, quantity } items, return the total inventory value.

Examples

  • inventoryValue([{name:"Pen",price:2,quantity:3}]) → 6

Constraints

  • Keep the required function name so the tests can find it
  • Return a value instead of only logging it
  • Do not mutate inputs unless the challenge asks you to
Inventory Calculator · editor

Code runs in an isolated Web Worker with a 3-second timeout — no DOM access, and it can never hang the page.