Practice: kiosk totals

Sum Nairobi kiosk units.

Sum units and shillings. Log the busiest city.

Goal

Log 25 units and Nairobi as busiest.

const rows = [
  { city: "Nairobi", units: 12, shillings: 480 },
  { city: "Mombasa", units: 8, shillings: 320 },
  { city: "Kisumu", units: 5, shillings: 200 },
];
const units = rows.reduce((acc, r) => acc + r.units, 0);
const shillings = rows.reduce((acc, r) => acc + r.shillings, 0);
const busiest = rows.reduce((a, b) => (a.units >= b.units ? a : b));
console.log("units", units);
console.log("shillings", shillings);
console.log("busiest", busiest.city);