codetogo.io icon indicating copy to clipboard operation
codetogo.io copied to clipboard

Use Case Suggestion: How to determine intersection between two arrays

Open tremendus opened this issue 1 year ago • 0 comments

const arrayOne = [ 1, 2, 3, 4, 5 ]
const arrayTwo = [ 4, 5, 6, 7 ]
const intersection = arrayOne.filter(item => arrayTwo.includes(item))

tremendus avatar Jan 27 '23 15:01 tremendus