Contador de palabras en JavaScript

 wordsCounter.innerText = text.replace(/\s+/g, " ").split(" ").length
Quaint Quail