Closed saschanaz closed 6 years ago
Well, that code actually translates to a SyntaxError: illegal character
because #
has higher precedence than the ternary operator, so it would be (x => x) ? ? : ?
.
I think you meant #(? ? ? : ?), and the arrow function equivalent would be (x,y,z) => x ? y : z
.
And I don't think that looks too weird. But if you do, you could write #((?) ? (?) : (?)) or #(?0 ? ?1 : ?2)
.
I think with syntax highlight it would be clear in the original case too.
x => x ? x : x
is a weird code but still is valid.If we use
?
it becomes:#? ? ? : ?
which is super weird.