return promise from async function javascript code example
Example 1: async await
const data = async () => {
const got = await fetch('https://jsonplaceholder.typicode.com/todos/1');
console.log(await got.json())
}
data();
Example 2: async function someFunction()
async function someFunction() {
console.log("someFunction");
}
Console.log("Start");
someFunction();
console.log("End");