Currently, this isn't breaking anything in my code but i keep seeing this is an error that usually causes serious issues but I don't know what's going on really or how to make the error go away. If anyone has any advice, that'd be great.
error: Function declared in a loop contains unsafe references to variable(s) 'i' no-loop-func
Relevant Code Segment:
let i = 0;
let interval = moment()
.day(days[0] + frequency * i)
.toDate();
while (moment(endDate).isAfter(interval)) {
days.map((day) =>
selectedDays.push(
moment()
.day(day + frequency * i)
.toDate()
)
);
interval = moment()
.day(days[0] + frequency * ++i)
.toDate();
}