Is Even with % or & (v3)

Revision 3 of this benchmark created on


Setup

const isEvenAm = (n) => (n & 1) === 0;
const isEvenMo = (n) => (n % 2) === 0;

Test runner

Ready to run.

Testing in
TestOps/sec
With & (Ampersand)
isEvenAm(2)
isEvenAm(1)
ready
With % (Modulo)
isEvenMo(2)
isEvenMo(1)
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.