Find common elements of two arrays | Thomas Oberbichler | Observable
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
ojs
Author
Thomas Oberbichler
@oberbichler
architect + engineer
Comments (2)
Igor A1
Oct 17, 2022
look 1st answer on
https://stackoverflow.com/questions/1187518/how-to-get-the-difference-between-two-arrays-in-javascript
Thomas Oberbichler
Oct 17, 2022
👍 a similar implementation is used in the "check" function to compute a reference solution (with a simple modification to remove duplicates). Here you can also find an article on this algorithm
https://en.wikipedia.org/wiki/Sort-merge_join
Reply
Add comment
Subscribe to notifications
© 2026 Observable, Inc.
Terms of service
Privacy policy
Product
About
Pricing
Documentation
Release notes
Contact us
Open source
Notebook Kit
Plot
D3
Community
Explore
Forum
Bluesky
YouTube
X
1
Follow
Follow
Find common elements of two arrays | Thomas Oberbichler | Observable