Is there a way to shorten this if statement in a reduce function. I tried using
acc = [...acc, v || ''];
but that just adds a empty string.
Object.entries(props).reduce((acc, [k, v]) => {
if (v) {
acc = [...acc, v];
}
return acc;
}, []);
I also want to not use the k in the [k, v] because linter is freaking out. How to not use the k variable but still get to the value variable ?