Exercise 2 · Chapter: ObjectsRequired+50 XP
Word Counter
Read a sentence from input. Count how many times each word appears and print each word with its count, sorted alphabetically.
Example: for the cat and the dog, print:
and: 1 cat: 1 dog: 1 the: 2
Need a hint?
3 available · costs 5 XP each
javascript
Output
Run your code to see the output here.