filmov
tv
JavaScript How to count words in a string?
Показать описание
We need the match method.
So we match the word boundaries globally in the string.
If the string has words it has word boundaries.
Two boundaries for each word.
Here you are.
We have got the word count.
So we match the word boundaries globally in the string.
If the string has words it has word boundaries.
Two boundaries for each word.
Here you are.
We have got the word count.