Rick Pendrick
09/30/2019, 3:00 PMfun String.asIndex(): Int = withIndex().sumBy { ... }
Why does the call to withIndex() not need use "it" or "this" ? <<I am newbie, obviously!>>marstran
09/30/2019, 3:09 PMthis
is implicit. You are in the context of a String inside the body of an extension function on String.marstran
09/30/2019, 3:09 PMfun String.asIndex(): Int = this.withIndex().sumBy { ... }
, but you just don't have to write this
.Rick Pendrick
09/30/2019, 3:12 PM