set.drop()

Drop elements given a count.

Lazy loading:

Yes

Signature

drop(count: Number) => Set<T>

Description

The drop() method drops count number of Set elements beginning at element[0]. This lets you "skip" the elements.

The source Set isn’t changed.

Parameters

Parameter Type Required Description

count

Number

Yes

Number of elements to drop. I count is greater than the Set length, an empty Set is returned.

Return value

Type Description

Set

A Set with count 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!