1
0
Fork 0
peertube/shared/core-utils/utils/array.ts
2021-11-03 14:23:55 +01:00

13 lines
205 B
TypeScript

function findCommonElement <T> (array1: T[], array2: T[]) {
for (const a of array1) {
for (const b of array2) {
if (a === b) return a
}
}
return null
}
export {
findCommonElement
}