class Fish {swim(): void {}
}class Bird {fly(): void {}
}switch(true) {case val instanceof Bird:val.fly()breakcase val instanceof Fish:val.swim()break
}
switch(true)
: means that it will validate each case, until it finds first when validated as true