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

x/rambda/immutable.d.ts>last

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

It returns the last element of input, as the input can be either a string or an array. It returns undefined if array has length of 0.

Parameters

str: ""

Returns

undefined

Parameters

str: string

Returns

string

Parameters

list: readonly []

Returns

undefined

Parameters

list: readonly never[]

Returns

undefined

Type Parameters

T extends readonly unknown[]

Returns

LastArrayElement<T>

Type Parameters

T extends readonly unknown[]

Returns

LastArrayElement<T>

Parameters

str: string

Returns

string | undefined