the following is the code I wrote while debugging, but I reported an error
function fn (x: number | string,y: number | string){
return x+y
}
but it"s okay to write like this
function fn (x: number,y: string){
return x+y
}
the following way of writing will also report an error
function fn (x: number | string,y: number){
return x+y
}
in my understanding, the + operation is the common operation symbol of number and string. Why does it report an error?