Hacker News new | comments | show | ask | jobs | submit login

For #1, why not suppy a success and failure callback function to your doSomeAsyncCall function? There is no reason to muddle those two lines of logic together (which is the real reason for the described error).

And for #2, Relying on javascript hoisting functions isnt a smart way to keep your code organized.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact