2.10.19 • Published 2 years ago
@extra-array/has-permutation.min v2.10.19
Checks if array has a permutation. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:
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
2.10.19
2 years ago
2.10.18
3 years ago
2.10.17
3 years ago
2.10.15
3 years ago
2.10.16
3 years ago
2.10.10
3 years ago
2.10.11
3 years ago
2.10.12
3 years ago
2.10.13
3 years ago
2.10.14
3 years ago
2.10.9
3 years ago
2.10.8
4 years ago
2.10.7
4 years ago
2.10.6
4 years ago
2.10.5
4 years ago
2.10.4
4 years ago
2.10.2
4 years ago
2.10.1
4 years ago