# Set multiple object values (\`a: b: undefined\`)

**URL:** <https://es.discourse.group/t/set-multiple-object-values-a-b-undefined/1052>\
**Category:** 💡 Ideas\
**Tags:** proposal\
**Created:** [October 24, 2021, 6:39am UTC](https://es.discourse.group/t/set-multiple-object-values-a-b-undefined/1052 "2021-10-24T06:39:24Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jithujoshyjy](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/jithujoshyjy/32/399_2.png) [@jithujoshyjy](https://es.discourse.group/u/jithujoshyjy)\
**Post date:** [October 24, 2021, 12:12pm UTC](https://es.discourse.group/t/set-multiple-object-values-a-b-undefined/1052/3 "2021-10-24T12:12:06Z")

</div>

How about extending the pick notation?

```javascript
const obj = Object.create(null)
obj.{prop1, prop2} = null
// obj.prop1 = obj.prop2 = null

// sadly the second one doesn't exactly match your interest
obj.{prop3, prop4} = getId()
// // obj.prop3 = obj.prop4 = getId()

```

I guess that behaviour should be implemented through loops;

```javascript
for(let x of ["prop3", "prop4"])
    obj[x] = getId()

```

---

_[View the full topic](https://es.discourse.group/t/set-multiple-object-values-a-b-undefined/1052)._
