counting:
arr.reduce((c, v) => c + (fn(v) ? 1 : 0), 0) == arr.filter(fn).length
number parsing:
parseInt("123") == eval("123")
parseFloat("1.23") == eval("1.23")
cast to integer:
Math.trunc(1.23) == ~~1.23
counting:
arr.reduce((c, v) => c + (fn(v) ? 1 : 0), 0) == arr.filter(fn).length
number parsing:
parseInt("123") == eval("123")
parseFloat("1.23") == eval("1.23")
cast to integer:
Math.trunc(1.23) == ~~1.23
That's right, we're gonna cheat.
That's right, we're gonna cheat.