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
Viktor Le -
Manoj Mohan -
Ayoola Damilare -
Trinmar Boado -
Top comments (1)
or you do
which is not only easier to read but also faster