Open oreliable opened 8 years ago
I see the point trying to be made. The point of a function is so that it can be reused as often as possible. Extracting the function to be by itself allows you to write less code and enhances the notion that the single point of failure is easier obtained. Also, that you can a more controlling perspective if you have to change it. Better off, in this case, you adjust the function to accept any string, so the callback just sends a string to be consoled.
If you are not working with Promises or Chains
Use closures, but don't nest them.
is probably the only chance to prevent "Callback Hell"
https://github.com/felixge/node-style-guide#no-nested-closures
This is a little funny considering the whole point of closures is to nest them so they close over variables in their parent scope.
The examples provided are just.. regular functions.