array.contains

This function checks whether the specified item is found in the specified array.

Syntax

array.contains(array, item)

Arguments

Argument

Type

Description

array

array of type any

The array in which the specified item needs to be searched.

item

any

The item to be searched for.

NOTE: The type of the item must match the type of the array.

Returns

Type

Description

boolean

  • True: if the item is found in the specified array

  • False: if the item is not found in the specified array

Examples

The function array.contains(array.create("A","B","C"), "B") returns true.