Summarize nested order data for a support dashboard.
Summarize an order object for a support dashboard. The final summary should expose payment status, shipping status, item count, and whether the order needs attention.
Write these functions:
isPaid(order) should return true when payment.status is "paid".
hasShipped(order) should return true when shipping.status is "shipped".
getDeliveryMessage(order) should return a shipping message and include estimatedDelivery when the order has shipped.
needsAttention(order) should return true when the order is unpaid or has not shipped.
createOrderSummary(order) should return id, customerName, paid, shipped, itemCount, deliveryMessage, and needsAttention.
Sample checks:
Expected output:
For itemCount, add item quantities instead of counting item rows.
Join the Community
roadmap.sh is the most starred project on GitHub and is visited by hundreds of thousands of developers every month.
Roadmaps Best Practices Guides Videos FAQs YouTube
roadmap.sh by @kamrify @kamrify
Community created roadmaps, best practices, projects, articles, resources and journeys to help you choose your path and grow in your career.
Login or Signup
You must be logged in to perform this action.