Beginner TypeScript
Q18 / 100

How do you specify that a function parameter is optional?

Correct! Well done.

Incorrect.

The correct answer is A) function greet(name?: string)

A

Correct Answer

function greet(name?: string)

Explanation

A "?" placed after the parameter name marks it as optional, allowing the argument to be omitted.

Progress
18/100