Can someone explain the subtle differences between the two following syntax?
(I am using rails and turbolinks with my coffeescript)
1) I've come across this recommended way of calling code.
windowReady = ->
customFunction = ->
...code...
jQuery ($) ->
...code...
$(window).load(windowReady);
$(window).on('page:load', windowReady);
2) I've also used the following syntax with no noticeable differences in behavior.
(->
customFunction = ->
...code...
jQuery ($) ->
...code...
).call this
What subtle differences should one watch out for with these two ways, and how would one address them? Is one more preferable than the other?