There was an error while loading. Please reload this page.
Check if iterable ends with a suffix.
Alternatives: hasValue, hasPrefix, hasInfix, hasSuffix, hasSubsequence, hasPath.
function hasSuffix(x, y, fc, fm) // x: an iterable // y: seach suffix // fc: compare function (a, b) // fm: map function (v, i, x)
const xiterable = require('extra-iterable'); var x = [1, 2, 3, 4]; xiterable.hasSuffix(x, [3, 4]); // → true xiterable.hasSuffix(x, [-3, -4]); // → false xiterable.hasSuffix(x, [-3, -4], (a, b) => Math.abs(a) - Math.abs(b)); // → true xiterable.hasSuffix(x, [-3, -4], null, v => Math.abs(v)); // → true