HN2new | past | comments | ask | show | jobs | submitlogin

The nice thing about it is that it allows you to break out of nesting hell while still being prototyped... e.g. window.setTimeout(this.foo.bind(this), baz);

Since .bind is essentially currying, you could imaginably do window.setTimeout(this.foo.bind(this, bar), baz) as well, if foo is dependent on bar (timing out a request `bar' or something like that).



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

Search: