Currently, I got an array like that:
var uniqueCount = Array();
After a few steps, my array looks like that:
uniqueCount =
You can solve it without using any for/while loops ou forEach.
function myCounter(inputWords) { return inputWords.reduce( (countWords, word) => { countWords[word] = ++countWords[word] || 1; return countWords; }, {}); }
Hope it helps you!