function countWords(str) {
let c=0;
for (x in str){
if(str[x]==" ")
c++;
}
return c+1;
}
function countWords(str) {
let c=0;
for (x in str){
if(str[x]==" ")
c++;
}
return c+1;
}
For further actions, you may consider blocking this person and/or reporting abuse
Tarzzo Tech -
Wallace Freitas -
Harsh Shah -
Xiao Ling -
Top comments (1)
or you do
which is not only easier to read but also faster