Not sure why he uses this as a code sample, as it's also not how someone would write code (though I suppose he is entitled to his style).<p><i>The original from the article</i><p><pre><code> function do_request(req) {
return long_io_operation(
req,
callback=function(results) {
return create_something_from(results);
});
}
</code></pre>
<i>How it might be written if you saw it in a codebase</i><p><pre><code> function do_request(req, callback) {
long_io_operation(req, function(err, results) {
callback(err, create_something_from(results));
});
}
</code></pre>
It seems like the article is not finished, so I can understand that there might be questionable sections. Also you'll note that he forgot the `error, results` argument pattern for callbacks, making me think that he is not terribly familiar with node.