Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Fully qualified name: Std.Arrays.Enumerated
function Enumerated<'TElement>(array : 'TElement[]) : (Int, 'TElement)[]
Summary
Given an array, returns a new array containing elements of the original array along with the indices of each element.
Type Parameters
'TElement
The type of elements of the array.
Input
array
An array whose elements are to be enumerated.
Output
A new array containing elements of the original array along with their indices.
Example
The following for
loops are equivalent:
for (idx in IndexRange(array)) {
let element = array[idx];
...
}
for ((idx, element) in Enumerated(array)) { ... }