data = data.map(
({
PlayerID,
Status,
TeamID,
Jersey,
PositionCategory,
Height,
Weight,
BirthDate,
College,
PhotoUrl,
Experience,
FanDuelPlayerID,
DraftKingsPlayerID,
FanDuelName,
DraftKingsName,
...rest
}) => rest
);
let eastern = data.filter((item) => item.InjuryStatus === "Out");
Asked
Active
Viewed 18 times
0

David
- 208,112
- 36
- 198
- 279

Allen Mordukhaev
- 1
- 2
-
Does this answer your question? [How do I check if an array includes a value in JavaScript?](https://stackoverflow.com/q/237104/328193) – David Jan 12 '22 at 19:44
1 Answers
0
I will make an assumption on this question. "You want to return an array with players that have more than one InjuryStatus, such as if the status is "Out" or the status is "Pending" "
Since you are using javascript as your language, there are a few ways to write this. I will go with the most direct way. I will use a simple boolean expression in the condition.
Using your statement, this would look like this:
let eastern = data.filter((item) => (item.InjuryStatus === "Out" || item.InjuryStatus === "Pending"));

thxmike
- 614
- 1
- 7
- 25