SyntaxFix
Write A Post
Hire A Developer
Questions
You can do it in a better way (up to 50 % faster than modulo operator):
odd: x & 1 even: !(x & 1)
Reference: High Performance JavaScript, 8. ->Bitwise Operators