Checks if array contains an infix.
npm install @extra-array/has-infixChecks if array contains an infix.
:package:
:smiley_cat:
:running:
:vhs:
:moon:
:scroll:
:newspaper:
:blue_book:
> Similar: [infix], [infixes], [hasInfix], [searchInfix].
> Similar: [hasValue], [hasPrefix], [hasInfix], [hasSuffix], [hasSubsequence], [hasPermutation], [hasPath].
> This is part of package [extra-array].
[extra-array]: https://www.npmjs.com/package/extra-array
``javascript`
array.hasInfix(x, y, [fc], [fm]);
// x: an array
// y: infix?
// fc: compare function (a, b)
// fm: map function (v, i, x)
`javascript
const array = require("extra-array");
var x = [1, 2, 3, 4];
array.hasInfix(x, [2, 3]);
// true
array.hasInfix(x, [-2, -3]);
// false
array.hasInfix(x, [-2, -3], (a, b) => Math.abs(a) - Math.abs(b));
// true
array.hasInfix(x, [-2, -3], null, v => Math.abs(v));
// true
``
- Data.List.isInfixOf: Haskell
- List-Extra.isInfixOf: elm
[infix]: https://github.com/nodef/extra-array/wiki/infix
[infixes]: https://github.com/nodef/extra-array/wiki/infixes
[hasInfix]: https://github.com/nodef/extra-array/wiki/hasInfix
[searchInfix]: https://github.com/nodef/extra-array/wiki/searchInfix
[hasValue]: https://github.com/nodef/extra-array/wiki/hasValue
[hasPrefix]: https://github.com/nodef/extra-array/wiki/hasPrefix
[hasSuffix]: https://github.com/nodef/extra-array/wiki/hasSuffix
[hasSubsequence]: https://github.com/nodef/extra-array/wiki/hasSubsequence
[hasPermutation]: https://github.com/nodef/extra-array/wiki/hasPermutation
[hasPath]: https://github.com/nodef/extra-array/wiki/hasPath