c/swift · by MortySmith@programming.dev · 2yIf you have more than 2 conditions, and do not want to recreate an element with if else statement, what do you do since ternary operations might get too confusing? 9 points · 3 comments · view on lemmy.world
3 Comments
breadsmasher@lemmy.world · 5 pts · 2y
A switch statement?
sjmarf@sh.itjust.works · 3 pts · 2y
One option would be to use an enum with a
labelcomputed property.barsquid@lemmy.world · 2 pts · 2y
It looks like an enum with calculated properties would be great here.