Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

227
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!