# Why does this promise chain print undefined?

**URL:** <https://forum.kirupa.com/t/why-does-this-promise-chain-print-undefined/679752>\
**Category:** web dev\
**Created:** [March 31, 2026, 10:00am UTC](https://forum.kirupa.com/t/why-does-this-promise-chain-print-undefined/679752 "2026-03-31T10:00:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HariSeldon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/hariseldon/32/31261_2.png) [@HariSeldon](https://forum.kirupa.com/u/HariSeldon)\
**Post date:** [March 31, 2026, 10:00am UTC](https://forum.kirupa.com/t/why-does-this-promise-chain-print-undefined/679752/1 "2026-03-31T10:00:05Z")

</div>

Consider this snippet.

```javascript
Promise.resolve(1)
  .then((v) => { v + 1; })
  .then((v) => console.log(v));

```

Why does this print `undefined`, and what one-line change fixes it.

Hari 🙂

---

<div class="post-metadata">

**Author:** ![BobaMilk](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/bobamilk/32/31157_2.png) [@BobaMilk](https://forum.kirupa.com/u/BobaMilk)\
**Post date:** [March 31, 2026, 10:14am UTC](https://forum.kirupa.com/t/why-does-this-promise-chain-print-undefined/679752/2 "2026-03-31T10:14:05Z")

</div>

It prints `undefined` because the first `then` callback uses braces but does not `return`, so change it to `.then(v => v + 1)` or add `return v + 1.` inside the braces.

BobaMilk
