how to get index of array in javascript when mapping code example Example: map index array.map((currentelement, index) => { });