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].

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!