Simplest code for array intersection in javascript
Asked 07 September, 2021
Viewed 1.5K times
  • 59
Votes

What's the simplest, library-free code for implementing array intersections in javascript? I want to write

intersection([1,2,3], [2,3,4,5])

and get

[2, 3]

30 Answer