withindices
.withindices from:{Iterable<Any>} -> Dictionary<Any>Content copied to clipboard
Associates each element of a collection with its index, starting at 1.
.var {letters}
- A
- B
.letters::withindices::foreach
.1::first .1::second
<!-- 1 A -->
<!-- 2 B -->Content copied to clipboard
Return
a dictionary whose keys are the indices of the elements, starting at 1, and whose values are the elements themselves
Parameters
from
collection to index
Chaining
This function is designed to be chained with other function calls:Iterable<Any>::withindices -> Dictionary<Any>Content copied to clipboard