Mid From PDF JavaScript JavaScript

What are callbacks?

A callback is a function passed as an argument to another function to be executed after

some operation completes.

Example:

function fetchData(callback) {

setTimeout(() => {

callback("Data received!");

}, 1000);

Follow me on LinkedIn:

}

fetchData(console.log);

More from JavaScript Tutorial

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details