For me, converting the ternary expression to a function within a function was far more readable.
I had multiple condition for every nested ternary expression and it was hell.
Think about if you have to add some code for one of the nested conditions, for me it's just more easier to have it like that.
It's also not mandatory to leave it like that, I find it easy to refactor the function and not a nested ternary that is on the same line.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
For me, converting the ternary expression to a function within a function was far more readable.
I had multiple condition for every nested ternary expression and it was hell.
Think about if you have to add some code for one of the nested conditions, for me it's just more easier to have it like that.
It's also not mandatory to leave it like that, I find it easy to refactor the function and not a nested ternary that is on the same line.