4 ms·
Old Coffeescript behaviour for => was to use a function where this was bound to that of the environment. This seems subtly different from having this not being
by irishsultan 9y ago
Old Coffeescript behaviour for => was to use a function where this was bound to that of the environment. This seems subtly different from having this not being bound at all (in that you can't rebind it under the new translation), but that's unlikely to have been a common use case.
The main other difference seems to be that there is no arguments object for the local function anymore, although once again that's unlikely to be a problem in most functions defined with a fat arrow.
As someone else also said, there were two ways to define functions, one using =>, one using -> the latter maps to a normal JS function.
- kbenson 9y ago> Old Coffeescript behaviour for => was to use a function where this was bound to that of the environment. Okay, so it sounds like coffeescript 1.0 => was effectively doing what JS => does now, so it makes sense to move to the newer JS syntax Thanks for elaborating! (It's interesting how "binds this" can, and was interpreted in multiple ways, Perhaps there's a better, more specific wording I could have used to cut through those misunderstandings, whether they be with those that replied or me reading their replies).