AI Frontend · Exercise 1 of 4Next
Beginner
Decode Without Breaking Characters
The route /api/ask sends the text Chai ☕ चाय 🙂 as bytes in packets of 3 bytes, so many characters are cut in two.
When #ask is clicked, read the response and put the whole text into #answer. It must show exactly Chai ☕ चाय 🙂, with no � marks.
What Check tests
#answeris empty before the click- After the click,
#answershows exactlyChai ☕ चाय 🙂 - There is no replacement character in
#answer - The code uses
TextDecoderStreamorstream: true
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.