@wallhackio May I see?
(The line of code that you wrote)
@vaporeon_ const max = (a, b, c) => a < b ? b < c ? c : b : a < c ? c : a;
@wallhackio Personally I would've split it into 2 lines to make it easier to read, but it's also fine like this 👍
Does your code often need to compare specifically 3 items?
@vaporeon_ I would never actually use this for a serious project I was just amusing myself by writing it in a single indecipherable line
This specific thing I was doing needed it. Except then I realized later actually I didn't need it lol so I got rid of it
@wallhackio > I would never actually use this for a serious project
Why not?
@vaporeon_ I would write it more clearly if it were something serious
@wallhackio By adding parentheses? Or splitting it across 2 lines?
@vaporeon_ if I were serious I would write it likeconst max = (a, b, c) => a < b
? b < c
? c
: b
: a < c
? c
: a;
or I would use an if else for the "outer" condition so there is no nested ternary
@vaporeon_ oh that reads nicely. cool style.