What this wrong with this?



Oops, try again. There was a problem with your syntax.

var greeting = function("Kathy") {
    console.log("Great to see you," + " " + "Kathy");

// On line 11, call the greeting function!


Problem is here:

var greeting = function("Kathy") {

What is the purpose of the function parameters? We use them to be able to send any data that we want to our function. Ok, you want to greet Kathy here, but what happens if in the future you will want to greet me? Will you create next function with the identical body? Nope.

In this exercise you have to define a parameter for your function, let's call it name and later use this parameter in the console.log to greet person with the name specified in the function call.

This is a scheme for you:

var greeting = function(name) {
    // console.log statement goes here, use name instead of "Kathy"

To test your function execute your function twice:


That's the power of functions.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.