Liczenie słów w ciągu JavaScript String

return str.split(' ').length;
Glamorous Gharial