Hacker News new | ask | show | jobs
by knd775 2557 days ago
Even better is 'is-even'. It depends on 'is-odd' and this is the entire thing:

  var isOdd = require('is-odd');
  
  module.exports = function isEven(i) {
    return !isOdd(i);
  };
1 comments

What does it return for zero?
(Thankfully?) it gets that right
Zero is even.