Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2
Short Answer: A callback function is a function passed as an argument to another function. Good Resource: https://www.freecodecamp.org/news/javascript-callback-functions-what-are-callbacks-in-js-and-how-to-use-them/ Examples: -------------------------------------------------- function sayHello() { console.log('Hello!'); } setTimeout(changeOutput, 3000); -------------------------------------------------- setTimeout(() => { function () { console.log('Hello!') }, 3000); -------------------------------------------------- setTimeout(() => { console.log('Hello!') }, 3000);
8th Sep 2020, 3:12 PM
Erich Buelow
Erich Buelow - avatar