We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Counts values which satisfy a test. 🏃 📼 📦 🌔 📒
Alternatives: count, countAs.
set.count(x, fn, [ths]); // x: a set // fn: test function (v, v, x) // ths: this argument
const set = require('extra-set'); var x = new Set([1, 2, 3, 4, 5]); set.count(x, v => v % 2 === 1); // 3 set.count(x, v => v % 2 === 0); // 2