SplitScript reference / [T] / contains

[T].contains

Method

[T].contains(value: T) -> bool where T: Equatable

Reports whether the array contains an equal element.

Elements are compared from the beginning of the array. The element type must support equality.

Parameters

  • value: The element to find.

Effects: pure

Runtime behavior: available everywhere; synchronous

Examples

Check a closed route table

let route = [2, 4, 7]
let visitsBoss = route.contains(7)