In LWC am trying to iterate over a list and show the details from the list, this is working correctly , but as a header want to show the record number in a displayed order, below is desired outcome and simplified sample code.
Desired OutCome:
Employee Record 1:
A
Employee Record 2:
B
Employee Record 3:
C
JavaScript:
Var empNames = ["A" , "B" , "C"];
HTML:
<template for:each={empNames} for:item="employee" for:index="index">
Employee Record{index}
{employee}
</template>
Actual outcome
Employee Record 0:
A
Employee Record 1:
B
Employee Record 2:
C
I understand as i am using {index} which indicated the position of element in an array which starts from 0 my actual outcome also starts like Employee Record 0 instead of Employee Record 1, but is there a simple way without writing much logic on JS to handle this in html and to make my headers starts from 1 instead of 0?