array.includes()

This method operates on an array. You typically fetch documents from a collection as a set, not an Array. For the equivalent Set method, see set instance methods.

For differences between Sets and Arrays, see Sets vs. Arrays.

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!