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

320
Vistas
why does my axios response typeof is string although it shows at console an array? thanks

when i print to console the type it gets a string and when i print the whole return i get an array here is the code:

this.formData = new FormData();
    this.resultFromServer = "";
    this.formData = new FormData();
  }
  postToGetData(type) {
    this.formData.append("data", type);
    axios({
      method: "post",
      url: this.url,
      data: this.formData,
      config: { headers: { "Content-Type": "multipart/form-data" } },
    }).then(
      (response) => {
        console.log(response.data);
        this.resultFromServer = response.data;
      },
      (error) => {
        console.log(error);
      }
    );
    console.log(typeof this.resultFromServer);
    console.log(this.resultFromServer);
    return this.resultFromServer;
  }
}
export default Api;

thank you very much!!

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