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