UNPKG

lenye_base

Version:

基础方法

12 lines (9 loc) 196 B
'use strict'; /** * Returns a list of elements that exist in both arrays. */ function intersect(a, b) { var s = new Set(b); return a.filter(x => s.has(x)); } module.exports = intersect;