Message from JavaScript discussions

September 2018

— Imo using an expression itself as control flow is wrong, while using the result of the expression in control flow is correct

Message permanent page


You have to consider that the operator is taking the values as inputs, doing extra operations even after the desired side effect (assignment) happens

— It's just a nit pick I have, I am too aware of all the details from the spec so I am always trying to avoid inefficiency, but aside from that I feel it makes code less readable too

Message permanent page

— He reuses them in big functions m8.... as in for different types depending on where in the function you are

Message permanent page

— Agreed

— But I chose the second solution

— Instead of using if....

— Always use the result

— Expressions always have a result, right? wat are you talking about is a matter of taste then

— What about

if a = object.thing
a.lenght = 0

— That doesn't look like an expression to me

— Yes, always. Not sure what you mean by that last part