---
date: 2025-04-15T10:48:16+00:00
modified: 2025-04-15T10:48:16+00:00
permalink: https://kaspars.net/note/mastodon-social-114342290845269798
post_type: note
author:
  name: Kaspars
  avatar: https://reverse.kaspars.net/gravatar/avatar/92bfcd3a8c3a21a033a6484d32c25a40b113ec6891f674336081513d5c98ef76?s=96&d=mm&r=g
---

# On April 15, 2025 at 13:48

Nested Destructuring 📜 ES6 (2015)

const user = { profile: { name: 'Ada' } };   
const { profile: { name } } = user;

Same as name = user.profile.name;

And you can rename the variable name to userName:

const { profile: { name: userName } } = user;