Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Getting the categories
const countCategories = categories.reduce((prev, curr) => {
prev[curr] = (prev[curr] || 0) + 1
return prev
}, {})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment