@extra-array/has-value
TypeScript icon, indicating that this package has built-in type declarations

2.10.19 • Public • Published

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.


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

Package Sidebar

Install

npm i @extra-array/has-value

Weekly Downloads

47

Version

2.10.19

License

MIT

Unpacked Size

5.48 kB

Total Files

8

Last publish

Collaborators

  • wolfram77