Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

40
Views
How do i add another Injury status there is more than one
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");
7 months ago · Juan Pablo Isaza
1 answers
Answer question

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"));
7 months ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.