DEV Community

Discussion on: What do you think about the ternary operator?

Collapse
 
shreyasminocha profile image
Shreyas Minocha

That's interesting. I didn't know some languages did it that way.

Collapse
 
kip13 profile image
kip • Edited

This is valid in all languages where if else are an expression instead of statement: Python, Rust, Scala, Kotlin, Haskell,F#....

Collapse
 
t4rzsan profile image
Jakob Christensen

F# does it too.