str.wordCounts()
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
replit ⟩ top N words
codewars ⟩ most frequently used words in text
// ⭐️ str.wordCounts()
String.prototype.wordCounts = function(
// word pattern
regex = /(?=[a-zA-Z'-]*[a-zA-Z])[a-zA-Z'-]+/g
){
const dict = new