All issues
Anti-pattern
Bug risk
Coverage
Documentation
Performance
Secrets
Security
Style
Type check
Using the standard i % 2 == 0 oddness check fails for -ve numbers. The preferred way is: i % 2 != 0 since +ve numbers leave +1 as remainder and -ve numbers leave -1 as remainder.
val isOdd = i % 2 == 0
val isOdd = i % 2 != 0