
Choose a concept
Choose a lesson on scope, closures, arrays, promises, or events. Read the worked example and predict its result before opening the explanation.
ExampleA function closes over count. Call it twice and predict whether the second call sees the updated count. Explain where that value is stored.
Trace and explain
For an asynchronous example, write down the synchronous statements and then the queued callbacks. Step through the visualization to check the order.
ExampleWith a log before a resolved promise callback and a log after scheduling it, explain why the two synchronous logs appear first.
Apply it in practice
Use the linked exercise or open a JavaScript challenge in Coding. Run visible tests and explain which language rule your implementation relies on.
ExampleUse a map in Two Sum and explain why looking up a missing key differs from retrieving a stored index of zero.
Check your work
You can explain a worked example and use the same rule on a new input or exercise.
Try it yourself
Write a prediction for three log statements. Log A, schedule a resolved promise callback that logs B, then log C. Check your prediction against the worked example for asynchronous execution.
- What to look for
- The synchronous code logs A and C before the promise callback logs B. Explain when the callback can run even though the promise is already resolved.