aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/core-utils/common/array.ts
blob: 9e326a5aa7590e4ab0dea051f240e2c4272a57c1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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
}