I have a function
function foo() {
return ["", 1, () => ""];
}
types are: string, number and (() => string)
however after I destructure those values
const [str, num, func] = foo();
compiler treats each variable as type: string | number | (() => string)
I want to pass these variables in functions, but compiler complains that types don't match and my IDE goes nuts with red text underlying. What can I do?