The is
check can be done in when
branch expressions as well. So here,
our when
has two branches, one for if the object is Frog
, plus an else
for other cases.
You can learn more about this in:
Tags: