I am trying to see if a variable passed to a function (that can be either an array of numbers or an array of tuples) is the array of tuples.
function (times: Array<number> | Array<[number, number]>) {
if (times[0] instanceof [number, number]) {
console.log("Its the tuple one!");
}
}
The above code doesn't work though and I've also tried if (times[0] instanceof tuple)) but that doesn't work either. How can this be done?
Thanks!