Comment

Comment by Kapow

That's just a ternary operator. I use that in Java all the time.

    value = boolean ? this_value : other_value;
If the branching logic gets too complicated, I usually move it into a function (private method) with a return in each branch.
parent Kapow 8 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton