1
0
Fork 0
peertube/shared/core-utils/common/array.ts
2021-12-17 12:24:03 +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
}