It appears that the CoffeeScript compiler will not implicitly return null unless it is required to prevent subsequent code execution. If something happens after this code, it will add a null return, for example:
if @isShown or event.isDefaultPrevented()
return
alert(1)
if (this.isShown || event.isDefaultPrevented()) {
return;
}
alert(1);
While in your case above the function will just exit anyway after the conditional expression without making an unnecessary return.
source
share