[Noisebridge-discuss] MongoDB Office Hours

Garrett Smith dhtmlkitchen at gmail.com
Tue Jul 21 23:04:13 UTC 2015


On 7/21/15, Henner Zeller <h.zeller at acm.org> wrote:
> On 21 July 2015 at 15:03, Jehan Tremback <jehan.tremback at gmail.com> wrote:
>
[...]

>
> +1
>

Unary plus is not needed here. The expression can be simplified to:

1

But that draws into question what the program was desgined to do in
the first place, because the result is not used. Also, there is no
semicolon here. Since a CallExpression is not a restricted production,
the program lends itself to the possibility of creating one by
accident, with the addition of any subsequent "grouping operator".
E.g. —

 +1
 ("wow");

Results in TypeError, as `1` is a number a numbers aren't callable.

 Thus:—


— is simpler and safer.
-- 
Garrett
@xkit
ChordCycles.wordpress.com
garretts.github.io
personx.tumblr.com


More information about the Noisebridge-discuss mailing list