JS

TypeScript Quiz - typescript code

4.

What is the problem with the following code?

function greet(name: string, age: number): void {
    console.log(`Hello, ${name}! You are ${age} years old.`);
}

There is no problem with the code.

The console.log statement is missing a semicolon.

The function is missing a parameter.

The return type is incorrectly specified.