How do I populate filters.
let filters = {};
To make it look like this:
filters = {
color: ["Blue", "Black"],
size: [70, 50]
};
So if I would have a function:
function populate(key, value) {
//if key is color value gets pushed to filters.color
//if key is size value gets pushed to filters.size
//if any other key, create new property with new name
}
So doing this would result in a new array in filters:
populate(material, "plastic");
And filters would look like this:
filters = {
color: ["Blue", "Black"],
size: [70, 50],
material: ["plastic"]
};