Count the number of words in the documents
const documents = [ ['a', 'b', 'c'], ['a', 'b', 'd'],]const result = wordCount(documents)result // => { a: 2, b: 2, c: 1, d: 1 } Copy
const documents = [ ['a', 'b', 'c'], ['a', 'b', 'd'],]const result = wordCount(documents)result // => { a: 2, b: 2, c: 1, d: 1 }
The documents to count words from (array of arrays of words)
A dictionary of words and their counts
Count the number of words in the documents
Example