Variables

index

Returns the index of the cur­rent item in the list func­tion, start­ing from 0.

Category
Lists
[1, 2, 3]
    .map( 
        current + index
    )/* This is the original list */
[1, 2, 3]

    /* 'map' will run operations on each item in that list */
    .map(

        /* Here the 'current' value (1, 2, etc.) is returned
        and added to the 'index' value (0, 1, etc) */
        current + index

    )
=
1, 3, 5