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

227
Visualizações
How to have json data dynamically in javascript variable?

I have the following reactjs code -

const [interviewerDetails,setinterviewerDetails] =useState([]);
    useEffect(()=>{
    const getinterviewerDetails= async ()=>{
      const data1 = await axios.get("http://localhost:8083/api/GetProduct")
      .then(response => {
        console.log("role is "+response.data[0].role)
        setinterviewerDetails(response.data)
        console.log(interviewerDetails)
      })
     .catch(error => { console.log(error) })
     setinterviewerDetails(data1);
      };  
  getinterviewerDetails();
  },[])
  console.log("interviewerDetails : ", interviewerDetails)

Which is giving the following response in console - enter image description here

Now, I want to have that json response as following -

var InterviewerObject = {
  "HR": {
    "Communication": ["Akshay ", "Images", "Tables", "Lists"], 
  },
  "Technical": {
    "PHP": ["Arvind Gupta", "Sri sharma", "Vidyut Tope"],
    "SQL": ["Akash Jha", "Mohit Mane", "Suresh Tupe"]
  }
}

I want to have select technical skill dynamically as PHP,SQL etc. And the firstname and lastname dynamically as Arvind Gupta , Sri sharma etc.

Can you please help me out ?

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