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

129
Vistas
How to select object with underscore or braces from HTTP Response?

I can select the heading object of this http response:

{data: Array(1), status: 200, statusText: 'OK', headers: {…}, config: {…}, …}
  data: Array(1)
    0:
      heading: "Hello World"

like this:

axios.get('/home')
    .then(res => {
        const $heading = res.data.heading;
    }

How would I select the heading object but for this http response:

{data: Array(1), status: 200, statusText: 'OK', headers: {…}, config: {…}, …}
  data: Array(1)
    0:
      heading_(en): "Hello World"

These attempts produce errors:

const $heading = res.data.heading_(en);
const $heading = res.data['heading_(en)'];

The same thing happens, when I try to select a response with:

heading_en: "Hello World"

by running:

const $heading = res.data.heading_en;
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

to get it, use res.data[0]['heading_en']

about 4 years ago · Juan Pablo Isaza Denunciar
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