Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/ahh/src/iter/mod.ts>I.last

Idiomatic type-safety functions.
Go to Latest
method I.last
import { I } from "https://deno.land/x/ahh@v0.10.1/src/iter/mod.ts";

Consumes an Iterator and returns the last item.

Examples

import { I } from "./mod.ts";

const iter = I.iter([1, 2, 3]);

console.log(I.last(iter)); // 3
console.log(iter.next()); // undefined