castTo

Cast the result of an evaluation to another type using the Arcade casting rules. Use to ensure that the final return value from a script is cast to an expected type in an Arcade-consistent manner. For more information on the casting behavior for each type, see ArcadeExpressionReturnType. Only types to which a value can be cast are available in ArcadeExpressionReturnType. Other types, such as com.arcgismaps.mapping.GeoElement, should be accessed via the result property. An exception is not thrown when casting fails. Instead, an error is returned whose value depends on the type of cast attempted.

Return

An object of the requested type or null.

Since

200.1.0

Parameters

toType

The type to cast to.