Using JavaScript in HTML web component

I would like to change the ternary operator to a switch statement in the HTML component but I'm getting "unexpected token switch" error. Is there something I'm missing or are not all JS functions available?


Is it that you have switch (foo) (with a space) instead of switch(foo)?

No the space does not make a difference. Cheers anyway. I've done a work-around by including the color in the datafield as a CSV and used .split() to access it.

Hey @jebit, glad to hear you found a work-around.

Multi-line code is not supported within the HTML. I would run this code block in a script or transformer in the future!