Array utils: unique items

This commit is contained in:
estib 2024-09-16 14:00:05 +02:00
parent 2dae466162
commit 75defc2ae6

View File

@ -28,3 +28,7 @@ export function chunk<T>(arr: T[], size: number) {
arr.slice(i * size, i * size + size)
);
}
export function unique<T>(arr: T[]): T[] {
return Array.from(new Set(arr));
}