Wednesday 24 January 2018

Random Practice Questions

Let's say I have some async method which checks some datastore. If a result is there, it returns result.dataToReturn, otherwise it will return undefined1.) is using cb(null, (result || {}).dataToReturn) bad form?2.) what about using cb(new Error(404) and checking for the error downstream?Which practice do you prefer? Any thoughts or comments welcome!

Submitted January 24, 2018 at 05:37PM by ShatteredVisage

No comments:

Post a Comment