Contador de palavras em JavaScript
wordsCounter.innerText = text.replace(/\s+/g, " ").split(" ").length
Quaint Quail
wordsCounter.innerText = text.replace(/\s+/g, " ").split(" ").length