HelperStable

Take

Keeps the first N elements of a typed collection while preserving their type.

Typed collection
Take
Collection
Resulting collection(s)

Vue d’ensemble

Keeps the first N elements of a typed collection while preserving their type.

Exemple

After sorting by priority, keep the five cases that should be handled first.

Parameters 2

itemsRequisobject[]
Typed collection supplied by a binding. The concrete element type is preserved or unified in outputs.
countRequisinteger
Maximum number of elements to retain from the start of the list.

Outputs 2

itemsobject[]
Sub-list containing at most the requested number of elements in input order.
countinteger
Number of elements in the resulting collection.

Behavior

The node returns a new list containing at most count elements in input order.

Key point Collection operations preserve the data classification carried by their elements; filtering, sorting, or concatenating a list is not declassification.

Limits and responsibilities

  • count = 0 returns an empty list.
  • The node does not choose any priority concept: input order remains the order used to select the first elements.