TypeScript | TypeScript Functions | Question7

Last Updated :
Discuss
Comments

What is the result of the following TypeScript code?

JavaScript
function add(x: number, y: number): number;
function add(x: string, y: string): string;
function add(x: any, y: any): any {
    return x + y;
}
console.log(add(5, 10));


15

"510"

NaN

undefined

Share your thoughts in the comments