const asyncFunction = async () => "HELLO";
const main = async () => {
const value = asyncFunction();
console.log(value === "HELLO" ? "true" : "false");
};
main();
Output: false
asyncFunction()
returns a promise not the resolved value.
Thanks for reading đź’™
Follow @codedrops.tech for more.
Instagram â—Ź Twitter â—Ź Facebook
Micro-Learning â—Ź Web Development â—Ź Javascript â—Ź MERN stack
codedrops.tech
Projects
File Ops - A VS Code extension to easily tag/alias files & quick switch between files
Top comments (0)