Step: Aggregate with add

Aggregate with add

add folds a stream/array into a single value: it sums numbers, concatenates strings, and merges arrays.

[1,2,3] | add          # => 6
map(.price) | add      # total price

Your turn: compute the total price of all products.

Input:
[
  {
    "name": "Widget",
    "price": 25,
    "category": "tools"
  },
  {
    "name": "Gadget",
    "price": 80,
    "category": "tools"
  },
  {
    "name": "Notebook",
    "price": 12,
    "category": "office"
  },
  {
    "name": "Pen",
    "price": 3,
    "category": "office"
  }
]
Expected:
120
Step 22 of 27