true
is implicit in switch
statements CRT-A0015If no tag is given with switch
, it assumes true
.
There is no need to pass the value true
. It could be omitted from switch
.
switch true {
case x > y:
}
switch {
case x > y:
}
Example:
switch true {
case x > y:
}
can be written as:
switch {
case x > y:
}