UNPKG

166 BJavaScriptView Raw
1'use strict';
2function count(x, ft) {
3 var a = 0, i = -1;
4 for (var v of x)
5 if (ft(v, ++i, x))
6 a++;
7 return a;
8}
9module.exports = count;