JavaScript · Junior · Question 74 of 75
What is a callback?
button.addEventListener("click", () => save());- ✓Correct answer: A function passed as an argument to be called later by other code
- 2A function that calls itself
- 3A function that runs on page load only
Explanation
Event handlers, setTimeout and array methods all take callbacks. Deeply nested async callbacks ("callback hell") led to promises and async/await.