How To Build a Word Counter App

We have all written essays during our school days. There was always a minimum word count - 250, 500 words - that we needed to meet before submitting. Before I had a computer at home I used to count words manually. Once my parents got me one, discovering Microsoft Word was like magic. I didn't know programming then, so I was amazed at everything that MS Word did.

One of the features that I really liked was called "Word Count". You could select any piece of text and click on Tools > Word Count to see some interesting statistics such as number of characters, words, and paragraphs about your selected piece of text. I loved it then and I'm even using it right now as I am drafting this article inside Google Sheets. I figured I'd take a crack at writing one myself.