function fn(x: number | Array<number>, y: number | Array<number>): void {
if (!Array.isArray(x)) x = [x];
if (!Array.isArray(y)) y = [y];
x.forEach((xs)=>{
y.forEach((ys)=>{
})
})
}
fn(1,2)
fn(x: number | Array<number>): any{
if (!Array.isArray(x)) x = [x] as Array<number>;
x.forEach....
// .....
}