set.drop()

Learn: Sets

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

true

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
  ]
}
\