3/13


#1

Hi
Can someone plz write the correkt program?


#2

It is better to post some code so we can help you to figure out what you did wrong .


#3

// On line 11, call the greeting function!
var gretting = function("David");


#4

Or this one??

var gretting = function ("David") {
console.log("Great to see you," + " " + "David");
};


#5

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

greeting("David")

is the correct code here is why:

the parameter (what is in the parentheses) is what you will be changing when you reuse the code later on (when you write long code) what is in the { } is what will be reused. When you call the function greeting and put ("David") after it that is saying make the parameter (what you will change in the code) David and where ever name is used like console.log("Great to see" + " " + name); it will replace name with what ever you put in the parentheses when you call the variable. If that doesn't make sense tell me and I will reword it. Good Luck!


#6

Thanks alot #magiccookie :smile: