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

14 lines
205 B
TypeScript
Raw Normal View History

2021-11-03 08:23:55 -05: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
}