I am using the following bit of code to set a filter. I have ESLint configured and am getting the following issue: Assignment to function parameter 'preferredDays' no-param-reassign
I don't quite see the issue this might cause. Is there a better alternative to the way I have handled it ?
function setPreferredDays(preferredDays) {
$(`#${IDS.PREFERRED_DAYS_VALUE} > button`)
.removeAttr('aria-selected');
if (!preferredDays) {
preferredDays = [1, 2, 3, 4, 5];
}
preferredDays.forEach(preferredDayValue => {
$(`#${IDS.PREFERRED_DAYS_SELECTION}`)
.find(`button[value= ${preferredDayValue} ]`)
.attr('aria-selected',
'true');
});
}