Skip to main content
Module

x/bettermap/mod.ts>BetterMap#at

An extension of the Map class with more Array-like features.
Latest
method BetterMap.prototype.at
import { BetterMap } from "https://deno.land/x/bettermap@v1.3.0/mod.ts";

Return the nth element of the map.

const map = new BetterMap<string, number>("People");
map.set("Doraemon", 10);
map.set("Dora", 28);
console.log(map.at(-1)); // 28

Parameters

pos: number

Position to get data.

Returns

V | undefined

Item at specified index.