1👍
✅
You are assigning a function to hidden not the result of this function. But if Condition = true returns true. Why not just do hidden: Condition
this will return the same result and doesn’t require a function call. Other option would be this construction.
for(let i =0; i < chartData.length; i++){
const hidden = Condition;
parsedData.push({
label: custNameArray[i],
data: [chartData[i]],
backgroundColor: "rgba(0, 142, 204, 1)",
hoverRadius: 9,
hidden
})
Source:stackexchange.com