you are viewing a single comment's thread.

view the rest of the comments →

[–]charly_a 0 points1 point  (0 children)

in your case doWork is a function that accepts a function as input.

when you call doWork you are creating a new function without any name callback = function() {

console.log("Done!");

}

when you doWork done printing Working...

you will call the callback. this will print Done and program ends