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

202
Views
How to use a parameter outisde a function (JavaScript)

I'm looking for a way to use a parameters outside his function, i wrote this:

await checkrequest(checkoptions, async function (error, response, body) {
                await console.error('error:', error); // Print the error if one occurred
                await console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
                await console.log('body:', body);
                var string;
                string = body.toString();
            });
        }while(string.includes("NotFound") == true)

But the body in the while Is not seen as already declared, I also tried to put the "var string" outside the function, but nothing, it doesnt take the body value.

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!