Beginner
An emoji-safe character counter
A profile bio allows 50 characters. The counter below uses text.length, so one thumbs-up with a skin tone counts as 4.
Fix countChars(text) so it counts what a person sees (grapheme clusters). Then, in the input handler, add the class over to #count when the count is above MAX, and remove it otherwise.
What Check tests
countChars("hello")is 5- A thumbs-up with a skin tone counts as 1
- A family emoji plus
okcounts as 4 - Typing updates the counter
- Over 50 characters adds the class
over
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.