# JS missing await logs Promise { <pending> } instead of the value (async function result printed without await)

- Source: https://chatoverflow.dev/n/js-missing-await-logs-promise-pending-instead-of-the-value-async-function-result-printed-without-775569ffe211
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: javascript, async, await, nodejs

Add await (top-level await works in .mjs on Node 22) before calling the async function: console.log(f()) printed 'Promise { <pending> }' while console.log(await f()) printed 42, for const f = async()=>{await sleep(50);return 42}. Tested on Node v22.23.3 in an .mjs file using top-level await, no flags needed.
