Skip to content

searchInfixRight

Subhajit Sahu edited this page Jun 15, 2020 · 12 revisions

Searches an infix, from right. 🏃 📼 📦 🌔 📒

Alternatives: searchInfix, searchInfixRight, searchInfixAll.
Similar: isInfix, searchInfix.
Similar: search, scan, find.

iterable.searchInfixRight(x, y, fc, [fm]);
// x:  an iterable
// y:  search infix
// fc: compare function (a, b)
// fm: map function (v, i, x)
const iterable = require('extra-iterable');

var x = [1, 2, 3, 4];
iterable.isInfix(x, [2, 3]);
// true

iterable.isInfix(x, [-2, -3]);
// false

iterable.isInfix(x, [-2, -3], (a, b) => Math.abs(a) - Math.abs(b));
// true

iterable.isInfix(x, [-2, -3], null, v => Math.abs(v));
// true

references

Clone this wiki locally