JS Count words in a string WITHOUT using a regex : There are many posts on the topic of how to count the number of words in a string in JS already, just wanted to make it clear I looked at these.

http://stackoverflow.com/questions/18679576/counting-words-in-string

http://stackoverflow.com/questions/6543917/count-number-of-words-in-string-using-javascript

As a very new programmer I would like to perform this function without the use of any regular expressions. I don't know anything about regex and so I want to use regular code, even if it is not the most effective way in the real world, for the sake of learning. 

I cannot find any answer to my question elsewhere, so I thought I would ask here before I default to just using a regex.