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

224
Vistas
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 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