3 ms·
You mean something like x % 2 === 1? I'm a JS fan but had to admit I chuckled at the implementation of is-even: https://github.com/jonschlinkert/is-even/blob/m
by tomduncalf 7y ago
You mean something like x % 2 === 1?
I'm a JS fan but had to admit I chuckled at the implementation of is-even: https://github.com/jonschlinkert/is-even/blob/master/index.js https://github.com/jonschlinkert/is-even/blob/master/index.j...
- soulofmischief 7y agoThat's hilarious. What's not hilarious is that, after removing the essentially useless error-checking, is-even is literally just `(n % 2) === 1`. On one hand, JS desperately needs a standard library, on the other hand, JS devs can be so infuriatingly lazy and obtuse.
- choward 7y ago> is-even is literally just `(n % 2) === 1` Pretty sure that tells you if a number is odd. I guess maybe there is a reason these libraries exist.
- soulofmischief 7y agoThat was just a typo, I meant the source for is-odd. I copy-pasted it. I use that exact syntax all the time in code, you don't need to be patronizing.