1
0
Fork 0
peertube/shared/core-utils/common/array.ts

14 lines
205 B
TypeScript
Raw Normal View History

2021-11-03 09:23:55 -04:00
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
}