Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's not confusing at all. It's the same thing your sample code does. In all three of your examples, the handler is bound to whatever scope widget is in. The code is functionally identical to your examples.

Edit: Okay, I see what you're doing; attach is supposed to be invoked with a bound scope, which does change the binding. So yeah, my code won't work in your example. I'd argue that that's more of a lack-of-context problem in the example though, since it's dependent on knowledge of the usage of the attach() function to know that that binding behavior isn't desired. Given the context of the example, I contend my solution was acceptable. :)

Fat arrow there is still functionally equivalent to $.proxy.



I'll save the fat arrow discussion for my next post, but the only point here is that it encourages nesting.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: