includes()

Test if the array includes the given value.

Signature

includes(value: T): Boolean

Description

The includes() method tests if the array includes the given value.

Parameters

Parameter Type Required Description

value

Any

Yes

Value to test against array elements.

Return value

Type Description

Boolean

Array included value status:
true = The array includes value.
false = The array doesn’t include value.

Examples

let iter = [1, 2, 3]
iter.includes(2)
true

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!