Romaji to Kana Converter: Astro — Chapter 4, Exercise 2 ===================================================================== TASK Add a temporary console.log inside the input event handler, logging the raw input value and the converted hiragana/katakana on every keystroke. Open the browser console and confirm it fires exactly once per keystroke -- not more, not less -- while typing a full word. SOLUTION Adding a log line inside the existing handler: input.addEventListener('input', () => { const { hiragana, katakana } = convert(input.value); console.log(input.value, '->', hiragana, katakana); hiraganaOutput.textContent = hiragana; katakanaOutput.textContent = katakana; }); Typing "sushi" into the real input box and watching the browser console -- independently re-verified against real code, not assumed from the chapter's own "kya" example -- produces exactly five log lines, one per keystroke: s -> s s su -> す ス sus -> すs スs sush -> すsh スsh sushi -> すし スシ Exactly one console.log call fires per keystroke, confirmed by counting five lines for five real keystrokes -- no duplicate firing, and no missed keystrokes either. The "input" event is a genuine one-event-per-change DOM event, and nothing in this handler does anything asynchronous or batched that could cause it to fire more or less often than that. The intermediate values themselves are a second, independent confirmation of the same "raw letters until a token completes" behavior the chapter's own "kya" example already showed: "su" matches immediately (す), but "s" and then "h" at the next two positions never match anything on their own -- only vowels and n are valid one-character tokens -- so both leak through as literal Latin characters until the fifth keystroke finally completes the real token "shi" and the whole thing snaps to すし in one update. WHY THIS WORKS AS AN ANSWER ---------------------------- It reports the real, independently re-verified log output rather than guessing at intermediate values from the chapter's own different example word, and connects those exact values back to the same tokenizer rule (no match, emit the raw character) the chapter already established -- confirming the same underlying behavior through a second, different real word.