how to check length of string in if statement javascript code example
Example 1: how to check how many strings are in a sentence javascript
function WordCounter (str) {
var words = str.split(" ").length;
return words;
}
// this should work!
Example 2: javascript string length
const s = 'Hello, World!';
console.log(s.length);