I have a use case of performing an API call, which accepts parameters like this:
api('str1', 'str2', 'str3');
I don't want to hardcode all parameters so I'm trying to do something like this:
const LIST: string[] = ['list-item-1', 'list-item-2'];
api('str1-hardcoded', LIST.join(','))
But this does not solve the issue, as join produces a single string from all items which is not what I want.
What would be the best way to handle this?