You somewhat painted yourself in a corner by using variable names like prodcat5, because you can't really iterate through them, without using the dreaded eval() function.
let arr = [];
for (let i=1; i<=10; i++) {
if (eval("prodcat" + i)) {
arr.push("prodcat" + i);
}
}
This is quite a bad way of doing it, eval() can, in general, present a security risk.
Another solution is, perhaps better (if you're running the code in a browser), is what ThatBrianDude came up with (look below), by (ab)using the window object.
But all these solutions are flawed, because the problem can be easily avoided. A much better solution is to have an array called prodcat and storing values in it like this:
prodcat[0] = true;
prodcat[1] = false;
/* etc... */
Then you can easily iterate through them.
[true, false, ..., true]to begin with?