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

149
Views
cómo empujar el valor de retorno de la función de carga a la variable global
var myids = ''; function passid(){ onload = function () { uidt = tempid.ssid; // some value getting from API } } passid(); console.log(myids);

¿Alguien puede ayudarme con esto? Cómo empujar uitd a var myids para que pueda usarlo donde quiera.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Su solicitud de API es definitivamente asíncrona, por lo que puede usar las promesas a través de async await si está dentro de una función asíncrona o luego y catche si está fuera de una función asíncrona

 var mydata = ''; async function apiReq(){ return await fetch('https://jsonplaceholder.typicode.com/todos/1').then(response=>response.json()).then(response=>{ mydata = response console.log("test"); console.log(mydata); }) } apiReq().then(response => { console.log("request is ok") console.log(mydata); });

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!