Typescript, Typescript With React, Programming, JavaScript, Technology.
function greet(age: number): string; function greet(value: string | number): string { if (typeof value === "string") { return `Hello, ${value}!`; } else { return `You are ${value} years old!`; } } const result1 = greet("Alice"); // Result: Hello, Alice! const result2 = greet(25); // Result: You are