4 ms·
You can also call the original method without the ugly leading comma like this: _.throttle( -> console.log("Foo") 500 )
by Perceptes 14y ago
You can also call the original method without the ugly leading comma like this:
_.throttle(
->
console.log("Foo")
500
)
- sic1 14y agoNice, got me thinkin and tried this: _.throttle -> console.log("Foo") , 500 And it works!
- Perceptes 14y agoThat's what the author of this Gist was trying to avoid.
- jewel 14y agoIs there any reason coffeescript can't be extended to support the same thing without parentheses? That feels fairly natural to me since it's similar to the object literal syntax. Edit: Couldn't find that this has ever been suggested before, so I created a github issue: https://github.com/jashkenas/coffee-script/issues/2307 https://github.com/jashkenas/coffee-script/issues/2307