Given
s, print the number of words in on a new line. For example,s = oneTwoThree. There are 3 words in the string.
I know I'm finding the letters that are capitalized, but not sure if I'm counting the words correctly.
What am I missing?
Input
saveChangesInTheEditor
Output
5
Right now, I'm getting 0.
function camelCase(s) {
let count = 0;
for(let i of s){
if(s.charAt(i) === s.charAt(i).toUpperCase()){
count++
}
}
return count
}