Your filters is not an array but an object. So, insert in the following way.
filters = { color: { red: true, blue: true }, size: { medium: false } };
filters.color['yellow'] = true;
filters.size['small'] = true;
console.log('filters=", filters);
1
solved how to push objects to an array with this structure? [closed]