JSPM

  • Created
  • Published
  • Downloads 181
  • Score
    100M100P100Q59214F
  • License MIT

Checks if array has a subsequence.

Package Exports

  • @extra-array/is-subsequence-on.min

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@extra-array/is-subsequence-on.min) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Checks if array has a subsequence.

This is part of package extra-array.

This is browserified, minified version of @extra-array/is-subsequence-on.
It is exported as global variable array_is_subsequence_on.
CDN: unpkg, jsDelivr.

array.isSubsequenceOn(x, y, [fn], [ths]);
// x:   an array
// y:   subsequence?
// fn:  map function (v, i, x)
// ths: this argument
// --> true if subsequence
const array = require('extra-array');

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

array.isSubsequenceOn(x, [-2, -4]);
// false

array.isSubsequenceOn(x, [-2, -4], v => Math.abs(v));
// true

references