1var myString = "string test";
2var stringLength = myString.length;
3
4console.log(stringLength); // Will return 11 because myString
5// is 11 characters long...
1function WordCounter (str) {
2 var words = str.split(" ").length;
3 return words;
4}
5// this should work!
1const s1 = 'javascript';
2const s2 = 'node.js';
3
4console.log(s1.length > s2.length); // true
1 var str = userInput[0];
2 var count = 0;
3 while(str[count] !== undefined)
4 {
5 count += 1;
6 }
7 console.log(count)