Generation

translateMon, 14 Nov 2022

getUnique = (array: any, key: string) => { const uniqueKeys = array.map((a: any) => a[key]) return uniqueKeys.map((k: string) => array.find((a: any) => a[key] === k)) }

getUnique = (array: any, key: string) => { const uniqueKeys = array.map((a: any) => a[key]) return uniqueKeys.map((k: string) => array.find((a: any) => a[key] === k)) }

TypeScript
Generate More

Questions about programming?Chat with your personal AI assistant