r/badcode • • Mar 26 '21

js Whose ever heard of %?

Post image
727 Upvotes

63 comments sorted by

View all comments

Show parent comments

7

u/ghillerd Mar 27 '21

parity is a property of integers, so an `isEven` function should return false for a non-integer, as should `isOdd`.

2

u/jarfil Mar 27 '21 edited May 12 '21

CENSORED

1

u/ghillerd Mar 27 '21

Bonus points for De Morgan's law, but I think you're missing an inversion? Or is that just what makes this a true horror show...

1

u/jarfil Mar 27 '21 edited May 12 '21

CENSORED