Command Palette

Search for a command to run...

Hectal
Phase 2: Streaming Fundamentals
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

  1. #answer is empty before the click
  2. After the click, #answer shows exactly Chai ☕ चाय 🙂
  3. There is no replacement character in #answer
  4. The code uses TextDecoderStream or stream: 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.