Re:Callbacks as our Generation's Goto Statement
by raycmorgan on Friday August 16, 2013 @03:49AM
(#6222698)
I would do it in Node.js like the following:
This follows Node's err convention. Note I use a bit of old fashion recursion to handle the asking for a valid name. This will not stack overflow due to the fact Ask is async. You could inline askName, but then you wouldn't have a nice little unit testable function.
[ Parent
| on HN ]
There are no comments on this comment yet.