Instance-of

Syntax

1
obj is Foo
Copied!

Explanation

Returns if the left operand is an instance of the right operand. If an object is an instanceof a class's superclass, this operator will return true for the superclass.

Examples

1
// Where: Dog IS-A Animal
2
let o := Dog { ... }
3
o is Animal
Copied!
Last modified 1yr ago
Copy link