@extra-array/is-permutation-on.min
TypeScript icon, indicating that this package has built-in type declarations

2.7.8 • Public • Published

Checks if array has a permutation. 🏃 📼 📦 🌔

Alternatives: compare, map.
Similar: permutation, permutations, isPermutation.
This is part of package extra-array.

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

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

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

array.isPermutationOn(x, [3, -1, -2, 4]);
// false

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

references

Package Sidebar

Install

npm i @extra-array/is-permutation-on.min

Weekly Downloads

166

Version

2.7.8

License

MIT

Unpacked Size

11.7 kB

Total Files

29

Last publish

Collaborators

  • wolfram77