It's fascinating how many people either love or hate this take


It's fascinating how many people either love or hate this take.

Some said it's "impossible to read". I don't get it.

If I read the code top-down, out loud, it says:

If status is success, green.
If status is error, red.
If status is warning, yellow.
Else black.

I still prefer a map in this case, but I find simple ternaries like this readable too.

View original on X