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
Marceli Borowczak -
James -
Talha Ahsan -
Ritesh Shukla -
Top comments (1)
or you do
which is not only easier to read but also faster