~maybe a dumb question, but, does the index in `fo...
# announcements
s
maybe a dumb question, but, does the index in
foldIndexed()
start at 0?
it does, my problem was something else 😅
k
If you're in doubt you can just call
println
inside of the lambda.
s
I did do this, actually, but it wasn’t matching what I’d get when I set a breakpoint and evaluated what
index
was in the middle of the lambda, which threw me off a bit
thought I was off by one, but I wasn’t quite ¯\_(ツ)_/¯
k
Really? The debugger should work fine I think, although line numbers can be wrong when dealing with inline functions.
s
This is honestly probably just a case of me misinterpreting the state of things, but while execution was paused, the IDE showed me two
index
values on that line, e.g.
index: 0 index$iv: 1
and when I evaluated index, it ostensibly gave me
index$iv