Re:Show HN: I built an extension of JavaScript in a day
by asynchrony on Sunday August 17, 2014 @12:32PM
(#8189717)
In Javascript
(contents !== null && contents !== undefined)
is equivalent to
(contents != null).
(again, beautified because DesignToJS crams everything in one line to preserve the line numbers of your actual code):
If you omit the function body, it will only expand to the end of the current logical 'context' (or whatever it's called)I'd suggest writing it like this in DesignToJS:
Result looks like this: Edit: I just submitted a patch that avoids unnecessary binding of 'this' if 'this' is not actually used.