Skip to content

Instantly share code, notes, and snippets.

@jmarmolejos
Last active October 29, 2018 19:02
Show Gist options
  • Save jmarmolejos/9347203cbb1c674f73da21b589465d24 to your computer and use it in GitHub Desktop.
Save jmarmolejos/9347203cbb1c674f73da21b589465d24 to your computer and use it in GitHub Desktop.
const a = [1,2,3]
const b = [2,3,4,5,6]
const intersection = a.filter(e => b.includes(e))
console.log(intersection) // [2,3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment