Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There is a return, it's disguised as "await"

*simplified*, the symantics of "await" are just syntactic sugar

    const value = await someFunction()
    console.log(value);
is syntactic sugar for

    return someFunction().then(function(value) {
      // this gets executed after the return IF
      // something else didn't remove all events like
      // loading a new page
      console.log(value);
    });


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: