Skip to content

Instantly share code, notes, and snippets.

@joynal
Created November 23, 2021 06:05
Show Gist options
  • Save joynal/a6b8274bcfc6b5b87d560cf87bdc5adb to your computer and use it in GitHub Desktop.
Save joynal/a6b8274bcfc6b5b87d560cf87bdc5adb to your computer and use it in GitHub Desktop.
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