codetogo.io
codetogo.io copied to clipboard
Use Case Suggestion: How to determine intersection between two arrays
const arrayOne = [ 1, 2, 3, 4, 5 ]
const arrayTwo = [ 4, 5, 6, 7 ]
const intersection = arrayOne.filter(item => arrayTwo.includes(item))