function first
first<T>(list: NonEmptyList<T>): T

Returns the first thing in a list. If the value is a string, then it will return the first character.

Examples

Example 1

first("hello"); // "h"
first([1, 2, 3]); // 1

Type Parameters

Parameters

Return Type

first(value: string): string

Parameters

value: string

Return Type

string