@extra-array/is-infix-on
v2.7.8
Published
Checks if array contains an infix.
Downloads
200
Maintainers
Readme
Checks if array contains an infix. :running: :vhs: :package: :moon:
Alternatives: compare, map. Similar: infix, infixes, isInfix. This is part of package extra-array.
array.isInfixOn(x, y, [fn], [ths]);
// x: an array
// y: infix?
// fn: map function (v, i, x)
// ths: this argument
const array = require('extra-array');
var x = [1, 2, 3, 4];
array.isInfixOn(x, [2, 3]);
// true
array.isInfixOn(x, [-2, -3]);
// false
array.isInfixOn(x, [-2, -3], v => Math.abs(v));
// true