Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
regexp 💘 at work solution in Clear category for Popular Words by vincent.tscherter
function popularWords(text: string, words: string[]) {
return words.reduce( (a,c) => ({
...a,
[c]: (text.match( new RegExp(`\\b${c}\\b`, 'ig')) || [] ).length
}), {})
}
April 23, 2020
Comments: