JSFiddle - React, Tailwind, and code Playground
by karthick6891
JavaScript
getGoogleResults = () => { // You don't need the async keyword here
const googleResultUrl = 'https://jsonplaceholder.typicode.com/todos/1';
return $.getJSON(googleResultUrl);
}
async function startProcess() {
const googleResults = await this.getGoogleResults();
console.log(googleResults); // this gets run immediately, produces 'undefined' in console
}
startProcess()