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

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

Examples

Example 1

last("hello"); // "o"
last([1, 2, 3]); // 3

Type Parameters

Parameters

Return Type

last(value: string): string

Parameters

value: string

Return Type

string