Hey, I’ve done quite a few small projects where performance wasn’t the main concern, and honestly, this simple one-liner does the trick for basic needs:
const intersection = (a, b) => a.filter(value => b.includes(value));
This is a great way to get a clean and readable javascript array intersection - super straightforward and easy to understand. Perfect for small arrays or quick scripts where simplicity matters more than speed.