Challenge 1: Identify the Long Task — Possible Solution ==================================================================== THE SCENARIO ------------- A button click triggers a function that loops over 10,000 array items doing synchronous work, taking 300ms total, before updating the DOM. WHICH SUB-PART IS MOST DIRECTLY INFLATED -------------------------------------------- PROCESSING TIME. WHY ---- The chapter defines processing time as "how long the handler itself takes to run" — this 300ms loop IS the event handler's own execution, running synchronously from the moment the click is processed until the DOM update happens. Since the entire 10,000-item loop executes as one continuous block of JavaScript with no yielding back to the browser in between, all 300ms of that work counts directly as processing time — the browser cannot paint anything, respond to other input, or do anything else while this handler is still executing. This is also, by the chapter's own definition, a textbook LONG TASK: anything occupying the main thread for more than 50ms qualifies, and this handler occupies it for 300ms — six times over that threshold — in a single uninterrupted block. A secondary effect worth noting: because this 300ms block occupies the main thread completely, it would ALSO inflate the input delay of any OTHER interaction a user attempts during those 300ms (e.g. if they click a second button while the first click's handler is still running) — but for THIS specific interaction (the one that triggered the loop), the delay was in its own PROCESSING, not in waiting for something else to finish first. WHY THIS WORKS AS AN ANSWER ------------------------------ The key distinguishing detail is WHERE the 300ms is actually spent: it's inside the handler's own execution (processing time), not in a delay before the handler could start (input delay) or in the gap after processing before the next frame paints (presentation delay). Since the scenario explicitly describes the loop itself as taking 300ms before any DOM update happens, that entire span maps onto processing time by the chapter's own three-part breakdown.