3

I am trying to execute the following function using async/await, but I getting the following error:

Uncaught SyntaxError: Unexpected token function

Using the following code:

async function getCsrfToken() {
    let token = '';
    await $.get(domain + '/mobile/token', result => {
        token = result;
    });
    return token;
}

My Editor isn't complaining about the syntax, but Chrome within Crosswalk is complaining about it. Am I doing something wrong or do I need to do something within crosswalk?

Get Off My Lawn
  • 34,175
  • 38
  • 176
  • 338

0 Answers0