---
title: "Discussion on \"JavaScript object destructuring usages you must know\" | Hashnode"
description: "Discussion on \"JavaScript object destructuring usages you must know\". JavaScript supports the destructuring assignment since ES6. Let us know the essential usages of it."
url: "https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [JavaScript object destructuring usages you must know](https://blog.greenroots.info/javascript-object-destructuring-usages-you-must-know?utm_source=hashnode&utm_medium=feed)

JavaScript supports the destructuring assignment since ES6. Let us know the essential usages of it.

Jan 17, 2022 · 8 min read · blog.greenroots.info  
Updated Nov 25, 2022  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#beginners](https://hashnode.com/tag/beginners)
-   [#codenewbies](https://hashnode.com/tag/codenewbies)

## Written by

[Tapas Adhikary](https://hashnode.com/@atapas)

@atapas · Bangalore

  
[View profile](https://hashnode.com/@atapas)

Educator @tapaScript | Founder CreoWis & ReactPlay - Writer - YouTuber - Open Source

Co-Founder, @CreoWis | Teacher, @tapaScript | Founder, @ReactPlay | YouTuber | Writer | Human

## Responses 9

Markdown supported · ⌘↵ to post

[Emilla Filipowicz](https://hashnode.com/@emillafilipowicz)

[May 13, 2024](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/6642a7bb7174a03eb2ead71b)

Hi, l've got some exciting news for you, l can teach you how you can turn your $150 into a whopping $4,600 in just 2 hours! Without interrupting your daily activities or sending money to anyone TEXT ME IF YOU ARE INTERESTED FOR MORE INFORMATION: 👇 WhatsApp No:+1 (209)-207-5967‬ Text No:+1 (209)-207-5967

[Zeshan Merchant](https://hashnode.com/@zeshan0603)

[Jan 6, 2024](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/65997a299bd412cbb4af653c)

Great article, I am a beginner in JavaScript and it was fun to learn this new syntax. I would like to add something.

In the following topic: 𝗛𝗮𝗻𝗱𝗹𝗲 𝗱𝘆𝗻𝗮𝗺𝗶𝗰 𝗻𝗮𝗺𝗲 𝗽𝗿𝗼𝗽𝗲𝗿𝘁𝘆 𝘄𝗶𝘁𝗵 𝗼𝗯𝗷𝗲𝗰𝘁 𝗱𝗲𝘀𝘁𝗿𝘂𝗰𝘁𝘂𝗿𝗶𝗻𝗴

where you created a function to get the key value dynamically, I thought of also adding the object as a parameter, so that we can deal with multiple objects and not hard code one object inside the function. Here is the code for the same :

function getPropertyValue(key,obj) { const {\[key\] : returnValue} = obj; return returnValue; }

const student = { name : "Tony" }

const nameFromEmp = getPropertyValue("name",employee); const nameFromStudent = getPropertyValue("name",student); console.log(`NAME OF STUDENT IS : ${nameFromStudent}`) console.log(`NAME OF EMP IS : ${nameFromEmp}`)

[Anand Baraik](https://hashnode.com/@anandbaraik)

[Nov 23, 2022](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/637e2cf435b255d5228ebe2e)

Very helpful. The way you explained everything is awesome.

[Tapas Adhikary](https://hashnode.com/@atapas)

[Nov 23, 2022](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/637e2cf435b255d5228ebe2e#reply-637e3a2925a8f7d5f98226bf)

Thanks a lot Anand 😀

[Dorin](https://hashnode.com/@slivki)

[Feb 5, 2022](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/61fed2a08d15cb3e7ce636d1)

Good to know! Btw, i wonder is there a theme for vs code, similar to what u've used coding javascript examples here. I love it.

[Tapas Adhikary](https://hashnode.com/@atapas)

[Nov 23, 2022](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/61fed2a08d15cb3e7ce636d1#reply-637e3a1825a8f7d5f98226af)

I use the GitHub theme

[Andrew Baisden](https://hashnode.com/@andrewbaisden)

[Jan 29, 2022](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/61f54cea6bb59d5767db6679)

Destructuring is so good!

[Tapas Adhikary](https://hashnode.com/@atapas)

[Jan 31, 2022](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/61f54cea6bb59d5767db6679#reply-61f7634800273a7c1776caca)

Indeed. Thanks for giving it a read, [Andrew](https://hashnode.com/@andrewbaisden)

[Mahesh](https://hashnode.com/@urstrulyvishwak)

[Jan 20, 2022](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/61e9b7b06b944f677207ed7d)

That's a nice article:

My version of the same is:

[JS Destructuring](https://vkglobal.hashnode.dev/js-destructuring)

[Tapas Adhikary](https://hashnode.com/@atapas)

[Jan 21, 2022](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/61e9b7b06b944f677207ed7d#reply-61ea27d26b944f677207f625)

Thank you, [Vishwak](https://hashnode.com/@vkglobal)

[Ankur Tyagi](https://hashnode.com/@TheAnkurTyagi)

[Jan 20, 2022](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/61e8fbba0204273bdcb13d67)

I love the way you teach. Kudos [Tapas Adhikary](https://hashnode.com/@atapas)

[Tapas Adhikary](https://hashnode.com/@atapas)

[Jan 20, 2022](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/61e8fbba0204273bdcb13d67#reply-61e90c390204273bdcb13f34)

Thanks a lot [Ankur](https://hashnode.com/@TheAnkurTyagi). It is encouraging coming from you.

[Idris Olubisi](https://hashnode.com/@olanetsoft)

[Jan 17, 2022](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/61e5eada00c806252387c7c0)

Well detailed! Thanks for sharing [Tapas Adhikary](https://hashnode.com/@atapas)

[Tapas Adhikary](https://hashnode.com/@atapas)

[Jan 18, 2022](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/61e5eada00c806252387c7c0#reply-61e622c5f6d40b3391ad6753)

Thanks a lot, Idris.

[Apoorv Tyagi](https://hashnode.com/@apoorvtyagi)

[Jan 17, 2022](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/61e5b13f8a425719c1736d15)

Great piece [Tapas Adhikary](https://hashnode.com/@atapas). Enjoyed reading it. Bookmarked👍

[Tapas Adhikary](https://hashnode.com/@atapas)

[Jan 18, 2022](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/61e5b13f8a425719c1736d15#reply-61e622e0f6d40b3391ad6757)

Very glad to know you enjoyed reading it. Thanks!

[Sachin Chaurasiya](https://hashnode.com/@Sachinchaurasiya)

[Jan 17, 2022](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/61e57fa700c806252387bd5e)

Helpful content Tapas. Yes Object destructuring can save us a lot of time.

Thanks for sharing 👍

PS : Cover image is looking super cool.

[Tapas Adhikary](https://hashnode.com/@atapas)

[Jan 17, 2022](https://hashnode.com/posts/javascript-object-destructuring-usages-you-must-know/61e54dac8a425719c173606f/comment/61e57fa700c806252387bd5e#reply-61e5893c00c806252387be81)

Thanks a lot [Sachin](https://hashnode.com/@Sachinchaurasiya). I love using this syntax a lot. You are welcome.

Thanks for noticing the cover image... At times it takes longer to think about it and make it. Thanks a lot.
