My task involves sifting through an array of objects to separate them based on their status codes. If the item
has a status code of 1
, I store it in the openIssue
array; if it has a status code of 3
, it goes into the inProgressIssue
array.
This is the relevant portion of my code:
openIssue = [];
inProgressIssue = [];
issuesNotCompletedInCurrentSprint.forEach((item) => {
if (item.statusId === '1') {
openIssue.push(item);
} else if (item.statusId === '3') {
inProgressIssue.push(item);
}
});
I received feedback during a code review stating:
Illegal use of filter
I'm seeking advice on how to correct this issue. Can someone please provide guidance?