Open this example in the interactive library
Source code
const entries: readonly (readonly [string, number])[] = [
["api", 2],
["web", 4],
];
console.log(Object.fromEntries(entries) as Record<string, number>);
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(Object.fromEntries(entries) as Record<string, number>);
{ api: 2, web: 4 }