Normalize API-shaped JSON data into article summaries.
An API response often contains more data than your program needs. Normalize the response into a smaller list of published article summaries.
Write these functions:
getPublishedArticles(response) should return only articles where status is "published".
toArticleSummary(article) should return an object with id, title, authorName, and views.
normalizeArticles(response) should return summaries for published articles only.
Sample checks:
Expected output:
Do not change the original apiResponse object.
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.