This blog-post has a good write-up:
https://codeburst.io/javascript-what-the-heck-is-a-callback-aba4da2deced
function doHomework(subject, callback) {_x000D_
alert(`Starting my ${subject} homework.`);_x000D_
callback();_x000D_
}_x000D_
_x000D_
function alertFinished(){_x000D_
alert('Finished my homework');_x000D_
}_x000D_
_x000D_
doHomework('math', alertFinished);
_x000D_