Returns if the intersection between two arrays is successful:
import { intersect } from 'ava-ia/lib/helpers'; const a = ['a', 'b', 'c']; const b = [1, 'b', 2]; const nums = [1, 2, 3]; intersect(a, b); // true intersect(a, nums); // false intersect(b, c); //true
'use strict'; export default (array1 = [], array2 = []) => { return array1.filter(item => array2.indexOf(item) != -1).length > 0; }
There was an error while loading. Please reload this page.
Feel free to offer new features, improvements or anything you can think of. This project makes sense with your participation and experience using Ava.