@extra-array/has-value.min
v2.10.19
Published
Checks if array has a value.
Downloads
6
Maintainers
Readme
Checks if array has a value. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:
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