set.includes()

Test if the Set includes the given value.

Signature

includes(value: Any) => Boolean

Description

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

Parameters

Parameter Type Required Description

value

Any

Yes

Value to test against Array elements.

Return value

Type Description

Boolean

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

Examples

// `toSet()` converts an Array to a Set.
let set = [1, 2, 3].toSet()
set.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!