Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

209
Views
How can I manipulate nested object in es6

I have to update one index among 3 options how can I manipulate them depends on option that a user clicked on the UI

CODES

[{
    future: false,
    NumberOfDay: 0,
    HourOption: ""
  },
 {
    within_date: false,
    start_date: "",
    end_date: ""
  },
 {
    indefinitely: false
}]

Expected output

in case user select the first option future and numberOfDay would be changed and output might look like the following on index one of this array

[{
    future: true,
    NumberOfDay: Entered_Number_From_User,
    HourOption: ""
  },
 {
    within_date: false,
    start_date: "",
    end_date: ""
  },
 {
    indefinitely: false
}]

in case user selects the second option on the UI

Output will be

[{
    future: false,
    NumberOfDay: 0,
    HourOption: ""
  },
 {
    within_date: true,
    start_date: `SELECTED_DATE_FROM_UI`,
    end_date: `SELECTED_DATE_FROM_UI`
  },
 {
    indefinitely: false
}]
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!