Asynchronous Error Handling
Asynchronous callbacks happen asynchronously. http://jsbin.com/laraqozi/1/edit This is pretty beginner stuff, or so I thought, But after having fixed a bug in YUI that cost hundreds of man hours, it seems worth discussing. function doSomethingBad() { throw Error("oh no!") } function deferCallback(f) { try { setTimeout(f, 100…