Lesson 09 · JavaScript
JavaScript Foundations: Capstone — The Word Analyzer
Build a word-frequency analyzer: normalize text, count words with an object, sort the entries, report the leaders, and guard risky parsing with try/catch.
Prerequisites: JavaScript Foundations: JSON & Data Exchange
Learning objectives
By the end of this lesson, you will be able to:
- Normalize raw text for analysis by lowercasing and stripping punctuation
- Split a paragraph into words and count them with an object
- Sort count entries numerically and report the top words
- Find the longest word with a plain, honest for..of loop
- Wrap a JSON payload and risky parsing in try/catch
- Assemble small functions into one working program