QuizNot attempted
Logging state right after setState
1–4 to choose, Enter to submit
Show answer & explanation
Correct answer:
0
setCountdoesn't change the localcountvariable- it schedules a re-render, and this render's closure still holds
0, so the log prints0. - Not 1: the new value exists only in the next render's
count. - Not undefined:
countwas initialised to 0. - Not nothing: the log runs synchronously in the handler.