Join Slack
Powered by
<@U691H4RA4> Kotlin Ranges are inclusive, so `0..2...
# getting-started
a
Andreas Sinz
10/11/2017, 11:12 AM
@oday
Kotlin Ranges are inclusive, so
0..2
produces
0, 1, 2
. So the
0..arr.count()
will iterate 1 step too far, you can use either
0..arr.count() - 1
or
1..arr.count()
. In your case it doesn't matter, because you dont use
i
anyway
2
Views
Open in Slack
Previous
Next