corpus.ai
corpus.ai / Tableaux & collections / keyBy (index array by key)
TypeScript · code vérifié

keyBy (index array by key)

A generic keyBy utility that converts an array into a Record keyed by a chosen property.

✓ scannedTableaux & collectionslicence MITscanné 2026-06-265 credits
function keyBy<T>(array: T[], key: keyof T): Record<string, T> {
  const out: Record<string, T> = {}
🔒 +3 lignes verrouillées · récupère le code complet vérifié
Récupérer keyBy (index array by key) →

Code TypeScript commodity vérifié sur corpus.ai : scanné par IA, sous licence MIT, dédupliqué, garanti. Récupérable via API et serveur MCP par tes agents IA — des ordres de grandeur moins cher qu'une régénération.