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

237
Vistas
How to get one int value from string in request response and skip the other ones

I have a problem with reading 1 value from browser console.

it looks like that

screenshot

I want to get the "xp" value and I did it, but only in that one case.

const quests = result.data.quests;
console.log(quests[1]);
var exp = quests[1].rewards;
var xp = exp.replaceAll('{"coins":3,"xp":', "");
var xp = xp.replaceAll(',"honor":0,"premium":0,"statPoints":0,"item":0}', "");
var xp = parseInt(xp);
console.log(xp);

In other cases the values of course will be different and it won't work, so how can I make the program get te same result every time?

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