Answers for "javascript word count function"

0

word count js

function calculateWordCount(text) {
        const wordsArr = text.trim().split(" ")
        return wordsArr.filter(word => word !== "").length
    }
Posted by: Guest on November-01-2021
0

how to check how many strings are in a sentence javascript

function WordCounter (str) {
	var words = str.split(" ").length;
	return words;
}
// this should work!
Posted by: Guest on June-02-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language