Skip to main content
Module

x/rimbu/mod.ts>Tuple.last

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
function Tuple.last
import { Tuple } from "https://deno.land/x/rimbu@0.14.0/mod.ts";
const { last } = Tuple;

Returns the last element of a Tuple.

Examples

Example 1

const t = Tuple.of(1, 'a', true)
console.log(Tuple.last(t))
// => true

Type Parameters

T extends readonly unknown[]
R

Parameters

tuple: readonly [...T, R]
  • the source tuple