@extra-array/is-suffix
TypeScript icon, indicating that this package has built-in type declarations

2.9.64 • Public • Published

Checks if array ends with a suffix. 🏃 📼 📦 🌔 📒

Similar: suffix, suffixes, isSuffix.
Similar: isValue, isPrefix, isInfix, isSuffix, isSubsequence, isPermutation.
This is part of package extra-array.

array.isSuffix(x, y, [fc], [fm]);
// x:  an array
// y:  suffix?
// fc: compare function (a, b)
// fm: map function (v, i, x)
const array = require('extra-array');

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

array.isSuffix(x, [-3, -4]);
// false

array.isSuffix(x, [-3, -4], (a, b) => Math.abs(a) - Math.abs(b));
// true

array.isSuffix(x, [-3, -4], null, v => Math.abs(v));
// true

references

Package Sidebar

Install

npm i @extra-array/is-suffix

Weekly Downloads

9

Version

2.9.64

License

MIT

Unpacked Size

13.6 kB

Total Files

29

Last publish

Collaborators

  • wolfram77