Drop

public struct Drop: Fn

Drop returns a new Arr or Page that contains the remaining elements, after num have been removed from the head of the Arr or Page coll. If drop value is zero or negative, elements of coll are returned unmodified.

When applied to a page, the returned page’s before cursor is adjusted to exclude the dropped elements. As special cases:

  • If drop value is negative, before does not change.
  • Otherwise if all elements from the original page were dropped (including the case where the page was already empty), before will be set to same value as the original page’s after.

Reference.

  • Declaration

    Swift

    public init(count: Expr, from collection: Expr)

    Parameters

    count

    Number of items to be dropped.

    collection

    Collection or page.