Function selectFromList

  • Selects an element from a list of provided items based on the specified index.

    Type Parameters

    • T

      The type of items in the list.

    Parameters

    • index: number

      The index of the item to select.

    • Rest ...items: T[]

      The list of items from which to select.

    Returns undefined | T

    • The selected item if the index is valid, otherwise undefined.

    Example

    const result = selectFromList(2, "one", "two", "three");
    console.log(result); // Output: "three"

Generated using TypeDoc