Live Coding: Making a Line Deduper with bitty
September 2025
My first use of bitty beyond the original examples. I used it to make a new tool for my tools site that dedups lines in text. I'm super happy with the way it works.
The Results
Here's the code:
HTML
JavaScript: /components/line-deduper/line-deduper.js
And a live example:
Type something like this into the left-hand box to see the duplicate line getting removed in the one on the right:
alfa bravo alfa charlie alfa delta
Notes
- Probably could have used filter and map to cut out a few lines. I don't have those in my head for JavaScript though.
end of line