let’s say I have the following array:
const arr = ["var1", "var2", "var3"];
and I have a function that takes strings as an arguments (but not array of strings):
func(var1, var2, var3)
so I tried:
func(...arr)
and func(arr.map((elem) => elem))
but obviously both of them return array so they can’t be passed to the function. The only method I know is by assigning them first:
const [var1, var2, var3] = ["var1", "var2", "var3"];
but it gets ugly if there are more variables in the array.
Is there any method that could achieve that?