PeerTube/shared/core-utils/common/array.ts

14 lines
205 B
TypeScript
Raw Normal View History

2021-11-03 14:23:55 +01: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
}