@extra-array/has-permutation.min
@extra-array/has-permutation.min
npm i @extra-array/has-permutation.min
@extra-array/has-permutation.min

@extra-array/has-permutation.min

An array is a collection of values, stored contiguously.

by nodef

2.10.19 (see all)License:MITTypeScript:Built-In
npm i @extra-array/has-permutation.min
Readme

Checks if array has a permutation. 📦 😺 🏃‍♂️ 📼 🌔 📜 📰 📘

Similar: permutation, permutations, hasPermutation.
Similar: hasValue, hasPrefix, hasInfix, hasSuffix, hasSubsequence, hasPermutation, hasPath.

This is part of package extra-array.

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


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

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

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

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

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


References

Downloads/wk

25

GitHub Stars

14

LAST COMMIT

7mos ago

MAINTAINERS

1

CONTRIBUTORS

3

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
2.10.19
latest
7mos ago
No alternatives found
No tutorials found
Add a tutorial

Rate & Review

100
No reviews found
Be the first to rate