Skip to content
Subhajit Sahu edited this page Dec 5, 2022 · 17 revisions

Check if any value satisfies a test.

Similar: some, every.


function some(x, ft)
// x:  a map
// ft: test function (v, k, x)
const map = require('extra-map');

var x = new Map([['a', 1], ['b', 2], ['c', -3], ['d', -4]]);
map.some(x, v => v > 10);
// → false

map.some(x, v => v < 0);
// → true


References

Clone this wiki locally