Lets say I have an object
filter: { \"ID\": false, \"Name\": true, \"Role\": false, \"Sector\": true, \"Code\": false }
In case you are dealing with 'scope' variables, this might be a better solution.
Object.keys(filter).reduce(function(accObj, parseObj) { accObj[parseObj] = false; return accObj; }, {});