Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
If it's JS, X can be a truthy value or a falsy value, this converts it to pure boolean.
-
You say that but in languages like Rust without a ternary operator you just end up writing `if X {true} else {false}`
Not sure if that's so much more understandable then a ternary tbh -
@theabbie the concept of "truthy" and "falsy" values is a crime against humanity in my eyes
-
Gem from my colleague in python:
f"{value}"
And, yes, value was always a string
"X ? true : false"
I love seeing these :D
Clearly a decent attempt at simplifying the code and at the same time missing the mark.
joke/meme