News for hackers. Stuff that matters.
Re:Can (a ==1 && a== 2 && a==3) ever evaluate to true? by senorerik on Tuesday January 16, 2018 @04:13PM (#16162661)
As long as we're writing bad code, here's my stab at the code golf version:

  i=0,a={valueOf:_=>++i}
- Omitting the variable statements in non-strict mode creates global (function scoped) variables

- The comma operator evaluates its operands left to right and returns the rightmost operand, the result of which is irrelevant in this case

- The arrow function allows us to omit parenthesis around the function parameters, so any single character variable name works (in this case _)

- The arrow function syntax also allows us to omit the curly braces, and will automatically return the body of the function.

- Automatic Semicolon Injection allows us to omit the trailing ;

There are no comments on this comment yet.