npm.io
2.10.19 • Published 4 years ago

@extra-array/has-value.min

Licence
MIT
Version
2.10.19
Deps
0
Size
6 kB
Vulns
0
Weekly
0
Stars
17

Checks if array has a value.

Similar: value, values, hasValue, searchValue.
Similar: hasValue, hasPrefix, hasInfix, hasSuffix, hasSubsequence, hasPermutation, hasPath.

This is part of package extra-array.

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


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

var x = [1, 2, -3];
array.hasValue(x, 3);
// false

array.hasValue(x, 3, (a, b) => Math.abs(a) - Math.abs(b));
// true

array.hasValue(x, 3, null, v => Math.abs(v));
// true


References

Keywords