20.
Which of the following is a valid example of using default function parameters in ES6?
function greet(name) { name = "Hello" }
function greet() { }
function greet(name) { }
function greet(name = "World") { }
Correct: D
Default function parameters allow us to specify default values for function parameters. For example, the default value for the name parameter is set to World. This means that if no argument is provided when calling the greet function, it will use by default the World as the name. The other examples do not show the correct syntax for using default function parameters.