.5: calling the greeting by passing it a name


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;

// Badly written function with syntax errors!

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

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,

functionName  =>  greeting

parameters    =>  name

to log        => "Greetings, " + name

to call       => greeting("Amanda");


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