import { array } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { lookup } = array;
Lookup the value in an array at the given index. If the index is out of bounds this function returns none.
Examples
Example 1
Example 1
import * as A from "./array.ts";
import { pipe } from "./fn.ts";
const result1 = pipe(
[1, 2, 3],
A.lookup(0),
); // Some(1)
const result2 = pipe(
[1, 2, 3],
A.lookup(100),
); // None