In answer to the comment:
Not a preset variable per se, but there is an answer here, that should help.
Try this, then. It's directely from the Adobe forums, and answers your question more directly.
for (var i = 0; i < input.length; i++) {
var ch = input.charAt(i);
var str = new String("" + ch);
if (i+1 != input.length && str === " " && "" + input.charAt(i+1) !== " "){
wordCount++;
}