Question: Let's imagine this JS object as below

```
document: any = {
    id: {
        photo: {},
        required: true
    },
    ph: {
        photo: {},
        required: true
    },
    zp: {
        photo: {},
        required: true
    }
};

```

is there a way to set all `required` properties to false?

Answer: 
Take the keys out ([Object.keys()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys)) loop through each key and change the desired property to desired value

```js
let any = { id: { photo: {}, required: true }, ph: { photo: {},required: true},zp: { photo: {},required: true   }};

Object.keys(any).forEach( e => any[e].required=false)

console.log(any)
```

If you want immutability you can use `reduce` instead of `forEach` 

```js
let any = { id: { photo: {}, required: true }, ph: { photo: {},required: true},zp: { photo: {},required: true   }};

let output = Object.keys(any).reduce((op,c) => {
  op[c] = {...any[c],required: false }
  return op
},{})
console.log(output)
```
Actually, you can simply use [for ... in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in) to traverse the object

```js
let any = {
    id: {photo: {}, required: true},
    ph: {photo: {}, required: true},
    zp: {photo: {}, required: true}
};

for (const key in any)
{
    any[key].required = false;
}

console.log(any);
```