Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

214
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda