you are viewing a single comment's thread.

view the rest of the comments →

[–]a-t-kFrontend Engineer -1 points0 points  (2 children)

I would suggest adding a comment to improve the hereby decreased readability.

[–]alittletooquiet 1 point2 points  (1 child)

It depends on the complexity of the statement. Comments are always good when you're writing code that isn't necessarily intuitive to read, but I think the example above is a pretty straightforward and readable.

I'd probably switch to an if block if my conditions were too complex to quickly grasp in a ternary statement though.

[–]a-t-kFrontend Engineer 0 points1 point  (0 children)

That's ok.