Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rambda/mod.ts>head

Faster and smaller alternative to Ramda
Go to Latest
function head
import { head } from "https://deno.land/x/rambda@9.2.1/mod.ts";

It returns the first element of list or string input.

Parameters

str: string

Returns

string

Parameters

str: ""

Returns

undefined

Parameters

list: never[]

Returns

undefined

Type Parameters

T extends unknown[]

Returns

FirstArrayElement<T>

Type Parameters

T extends readonly unknown[]

Returns

FirstArrayElement<T>