Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/ahh/mod.ts>I.inspect

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

Creates an Iterator that calls f on each item and yeilds the original item.

Examples

Example 1

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

const iter = I.inspect(I.iter([1, 2, 3]), (i) => i * i);

console.log(iter.next()); // 1
console.log(iter.next()); // 2
console.log(iter.next()); // 3
console.log(iter.next()); // undefined

Parameters

iter: Iterator<T>
f: (_: T) => unknown