In the following example, we first use current to return the values of the original list (1, 2, 3) and then add the index value (0, 1, 2) to each of those. The result is a new list of numbers: 1, 3, 5
current
1
2
3
index
0
5
[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, 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 )