DEV Community

Mehul Lakhanpal
Mehul Lakhanpal

Posted on • Originally published at codedrops.tech

Async function return promise by default

const asyncFunc = async () => "hi";

asyncFunc().then((result) => console.log(result)); // hi

// is same as

const asyncFunc = async () => {
  return Promise.resolve("hi");
};
Enter fullscreen mode Exit fullscreen mode

Thanks for reading 💙

Follow @codedrops.tech for daily posts.

InstagramTwitterFacebook

Micro-Learning ● Web Development ● Javascript ● MERN stack ● Javascript

codedrops.tech

Top comments (0)