'Why there is a difference of 1 word in word count shown in TinyMCE editor and Function that returns text statistics for an editor instance by id

I was trying to limit the word count in TinyMCE editor. For that used a function suggested in the documentation of TinyMCE https://www.tiny.cloud/docs-3x/howto/words/. This function always returns word count greater by 1 than the word count shown in the editor's status bar. For eg: if we empty the editor, the word count in status bar of editor shows 0 but function returns 1. Likewise the word count is 10 on editor, function returns 11. Why that function returns different value and how can I match these values?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source