Created
November 23, 2021 06:05
-
-
Save joynal/a6b8274bcfc6b5b87d560cf87bdc5adb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { deepStrictEqual } = require('assert'); | |
const wordCounter = (line) => { | |
// implement me! | |
} | |
const input = 'This is some random text and some raddom work'; | |
const want = { | |
This: 1, | |
is: 1, | |
some: 2, | |
random: 1, | |
text: 1, | |
and: 1, | |
raddom: 1, | |
work: 2, | |
}; | |
deepStrictEqual(wordCounter(input), want, 'mutable approach failed'); | |
console.log('test passed'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment