I have the following data structure which I want to pass as a parameter into a function.
let structure = [6, [197,47,28,191,198,129,117,82,171]] It's given that the first element is always a number and the second element an array of numbers. When I want to pass it to my function, my IDE suggests following as input types:
function myFunc(structure:(number | number[])[]) { .... } This leads to problems because it is not specific enough. I know the first element is always a number, but based on my type declaration it doesn't have to be.
How do you declare the type here properly in typescript?
[number, number[]]{ id : number; data : number[] })?