4 ms·
Instead of this: $ 'body' .click (e) -> $ '.box' .fadeIn 'fast' .addClass '.active' .css 'marginRight', '10px' You used to have to do this:
by rayshan 13y ago
Instead of this:
$ 'body'
.click (e) ->
$ '.box'
.fadeIn 'fast'
.addClass '.active'
.css 'marginRight', '10px'
You used to have to do this:
$('body')
.click (e) ->
$('.box')
.fadeIn('fast')
.addClass('.active')
.css 'marginRight', '10px'
Note the extra ( )s, if not used, the next method call is not recognized as a method call but rather part of the previous call's argument. The last method call did not and does not need to be closed with ( ).
This is hugely important for libraries like d3 with super long call chains.