Module

x/rambda/immutable.d.ts>head

Faster and smaller alternative to Ramda
Latest
function head
import { head } from "https://dotland.deno.dev/x/rambda@9.4.1/immutable.d.ts";

It returns the first element of list or string input. It returns undefined if array has length of 0.

Parameters

str: string

Returns

string

Parameters

str: ""

Returns

undefined

Parameters

list: readonly []

Returns

undefined

Parameters

list: readonly never[]

Returns

undefined

Type Parameters

T extends readonly unknown[]

Returns

FirstArrayElement<T>

Type Parameters

T extends readonly unknown[]

Returns

FirstArrayElement<T>