if-else vs switch

Here’s the code if you want to experiment with it!

switch (boolean1: boolean1, boolean2: boolean2, boolean3: boolean3) {

case (boolean1: true, _, boolean3: false):
    functionA()
case (_, boolean2: false, boolean3: true):
    functionB()
case (boolean1: true, boolean2: false, boolean3: false):
    functionC()
default:
    break
}
Previous
Previous

isNilOrEmpty

Next
Next

variadic arguments