Check out v4 of the Fauna CLI

v4 of the Fauna CLI is now in beta.

The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start.

set.drop()

Drop the first N elements of a Set.

Loading strategy:

Signature

drop(amount: Number) => Set<A>

Description

Drops a provided number of elements from a Set, beginning at element[0]. This lets you "skip" the elements.

The calling Set isn’t changed.

Parameters

Parameter Type Required Description

amount

Number

Yes

Number of elements to drop. If this value is greater than the Set length, an empty Set is returned.

Return value

Type Description

Set<Generic>

A Set with the elements dropped.

Examples

// `toSet()` converts an Array to a Set.
let set = [1, 2, 3, 4, 5].toSet()
set.drop(2)
{
  data: [
    3,
    4,
    5
  ]
}

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!