Skip to content
RED SAG Skills
hard20 pts · first answer countshash-mapjavascriptdebugging

Word counts that break on "constructor"

This word counter gives a strange string for the word "constructor". Why?

const counts = {}
for (const w of words) counts[w] = (counts[w] || 0) + 1
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions