When working with a multidimensional array where each element has the same type, declaring it is straightforward: string[][]
.
But what about when each array is different?
function create3DArray(arg): // <----???
{ firstArray: string[] = []
secondArray: number[] = []
thirdArray: CustomType[] = []
return [firstArray, secondArray, thirdArray]
}
I have checked out resources like typescript multidimensional array with different types, but I'm still unsure of how to proceed.