All issues
Anti-pattern
Bug risk
Coverage
Documentation
Performance
Secrets
Security
Style
Type check
for (i <- 0 to n - 1) is the common way to count from 0 till n. However, a more readable and appropriate way might be to adopt the 'until' keyword.
for (i <- 0 to n - 1) { println(i) }
for (i <- 0 until n) { println(i) }