Can you give me an example of a greeting function


#1

can some one help me


#3

When we read, "a greeting function" it means we are to write a function and give it the name, greeting.

Function basics:

var
identifier
=
function
(parameter)
{ 
// function body code
};

as in,

var foo = function (bar) {
    console.log("foo" + bar);
};

And when we wish to call (invoke) the function, we write,

foo("bar");

The output will be,

foobar

Now you try with greeting and inside the function use the exact text given in the instructions. Remember to call your function, afterward.


#4

can you shorten that down by giving an example of a greeting function


#5

it says that I need to give it a name


#6

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