Over the past few days, I've developed a word counter using HTML, CSS, and vanilla JavaScript. I tried my hand at BEM architecture; variables, nesting, modules, inheritance, and parent selectors in Sass; and regular expression and DOM manipulation in JavaScript. Before pushing my project to GitHub, I decided to try using ESLint and Prettier in VSCode with the Air BnB style guide. Although this page counter was very small, I wanted to make sure its code was as clean as possible.
ReadI decided to build a word counter that would give the user the exact number of words and characters and an estimated number of page numbers for text that the user inputs into a textarea. I wanted to make the word counter bilingual and offer instructions to the user in both English and Japanese. Because the Japanese language does not use spaces, users who choose to input text in Japanese would only be able to make use of the character count and the page number estimate.
Read