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

345
Views
When does the export statement runs in node js?

When does the export statement run? Is it before callbacks run. In that case, var1 and var2 will be undefined. Or is it after callbacks are completed?

let var1 = someAsyncFunction(param1).then( result => anotherFunction(result));
let var2 = someAsyncFunction(param2).then( result => anotherFunction(result));

export {var1 ,var2}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Is it before callbacks run.

Yes.

In that case, var1 and var2 will be undefined.

No. The then method returns a promise. It doesn't return undefined.

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