Open this example in the interactive library
Source code
const entries: readonly (readonly [string, number])[] = [
["api", 2],
["web", 4],
];
console.log([...new Map<string, number>(entries)]);
Sample output
[ [ 'api', 2 ], [ 'web', 4 ] ]

Open this example in the interactive library
const entries: readonly (readonly [string, number])[] = [
["api", 2],
["web", 4],
];
console.log([...new Map<string, number>(entries)]);
[ [ 'api', 2 ], [ 'web', 4 ] ]