Lets say I have an object
filter: { \"ID\": false, \"Name\": true, \"Role\": false, \"Sector\": true, \"Code\": false }
With ES6 features one-liner without mutation:
{ ...Object.keys(filter).reduce((reduced, key) => ({ ...reduced, [key]: false }), {}) }