I have a problem that I want to go through an array with a for loop, but for some reason the loop doesn't go through it and just prints the first element of the array everywhere.
Here is my array with the days:
readonly days: WeekDayName[] = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
And my functions is what it looks like now:
get dayName() {
for (const { item, index } of this.days.map((item, index) => ({ item, index }))) {
return (item);
}
}
How can I solve not just print the first item everywhere?