Ternary operator for Switch

This can also be written on multiple lines, for instance with the colons forming a vertical ellipsis:

let x = (a == .small)  ? 10
      : (a == .medium) ? 20
      : (a == .large)  ? 30
      :                   0
3 Likes