The position from 0 to get.
The element if exists.
import { atMay, range } from "./list.ts";
import * as Option from "./option.ts";
import { assertEquals } from "../deps.ts";
const nums = range(1, 6);
assertEquals(atMay(0)(nums), Option.some(1));
assertEquals(atMay(4)(nums), Option.some(5));
assertEquals(atMay(-1)(nums), Option.none());
assertEquals(atMay(5)(nums), Option.none());
Generated using TypeDoc
Gets the value at
index
. It takes O(n).