nodeJs callbacks simple example

var myCallback = function(data) { console.log(‘got data: ‘+data); }; var usingItNow = function(callback) { callback(‘get it?’); }; Now open node or browser console and paste the above definitions. Finally use it with this next line: usingItNow(myCallback); With Respect to the Node-Style Error Conventions Costa asked what this would look like if we were to honor … Read more