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

179
Views
Returning a result from an asynchronous function call
 async function checkStreamStatus(channelName) {
  const response = await  fetch(`https://api.twitch.tv/helix/streams?user_login=${channelName}`,  {

    headers: {
      'Authorization': 'Bearer ' + '',
      'Client-Id': '',
      
    }});

  const json = await response.json();
  const type = json.data[0]?.type;
  
  status = type;
  //console.log("worked " + status)
  
  if (status === "live") {
    return true;
  }
  else {
    return false;
  }
  
  
 }

My brain couldn't handle how async function works even i watched 3 videos and spent 3 hours how can i return true and false from this function

enter image description here

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!