.5: calling the greeting by passing it a name


#1

Hey all,

So I cannot seem to understand by what it means to call the greeting.

// Nicely written function:
var calculate = function (number) {
    var val = number * 10;
    console.log(val);
};

// Badly written function with syntax errors!

var functionName = function(parameters) {
    var name = greeting + Amanda.string;
    console.log(name);
};

The error reads: "You did not call the greeting function. Pass it a name!"

Can someone explain this to me or give me an example? I am very confused!

Much thanks,
Amanda


#2
functionName  =>  greeting

parameters    =>  name

to log        => "Greetings, " + name

to call       => greeting("Amanda");

#3

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