2 comments

[ 2.7 ms ] story [ 14.8 ms ] thread
> In another case, I saw an NPM package that detects if the number is odd or even. Writing n%2 == 0 is that hard thing?

Repository in question:

'use strict';

var isOdd = require('is-odd');

module.exports = function isEven(i) { return !isOdd(i); };