Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

211
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda