Zum Hauptinhalt springen

Type.Is

Bestimmt, ob ein Wert des ersten Typs immer mit dem zweiten Typ kompatibel ist.

Syntax

Type.Is(
type1 as type,
type2 as type
) as logical

Remarks

Bestimmt, ob ein Wert type1 immer mit type2 kompatibel ist.

Examples

Example #1

Bestimmen Sie, ob ein Wert vom Typ „number“ immer auch als Typ „any“ behandelt werden kann.

Type.Is(type number, type any)

Result:

true

Example #2

Bestimmen Sie, ob ein Wert vom Typ „any“ immer auch als Typ „number“ behandelt werden kann.

Type.Is(type any, type number)

Result:

false

Category

Type