From Dev.to
Counting words in the browser: why split(/\s+/) is not enough
Counting words looks like a one-liner: text.split(/\s+/).length. It works for English prose and fails quietly for most of the world. Here is what I ran into while building a word counter that runs ent...
