Beginner Ruby
Q36 / 100

How do you define a method with a default parameter value?

Correct! Well done.

Incorrect.

The correct answer is A) def greet(name = "World") ... end

A

Correct Answer

def greet(name = "World") ... end

Explanation

Default parameter values are specified with "=" in the parameter list, used when the caller omits the argument.

Progress
36/100