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)