JavaScript · Junior · Question 74 of 75

What is a callback?

button.addEventListener("click", () => save());

Explanation

Event handlers, setTimeout and array methods all take callbacks. Deeply nested async callbacks ("callback hell") led to promises and async/await.

Further reading

Problem with a question

JavaScript · Junior · question 74

Test yourself

Take the JavaScript · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz