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
Evan Charalampidis -
Vinod Kumar -
Asim khan -
Valery Zinchenko -
Top comments (1)
or you do
which is not only easier to read but also faster