1
your function getData will return a Promise. So you can : await the function as well to get the result. var x = await getData(); console.log(x); or use the result as a normal Promise, which is what an async function returns : you have to use then with a callback : getData(...