Mwnci enumerate() Function

Syntax

enumerate(array, [integer])

Description

The enumerate() function returns the contents of an array as a collection of array pairs, and adds a counter as the key of the enumerate array.

If no count start value is given, then 0 is used

Example

include("main")
a=["Red", "Yellow", "Blue"]
println(enumerate(a))
println(enumerate(a, 100))


[[0, "Red"], [1, "Yellow"], [2, "Blue"]]
[[100, "Red"], [101, "Yellow"], [102, "Blue"]]