New course! Every coder should learn Generative AI!
Try a free lesson+ 5
It is old syntax, accepting another function as argument and executing it when some condition is met.
callback demo :
https://code.sololearn.com/Wy2AY0u7kOb9/?ref=app
Instead use the new syntax of Promise and async/await for improving readability.
async demo:
https://code.sololearn.com/W9r6G80mFY7p/?ref=app
async lesson:
https://code.sololearn.com/WHg45t9f05if/?ref=app