Receiving an error that I do not understand or can resolve


#1


5. Tying it all together


Ops, try again. You did not call the greeting function. Pass it a name
The console.log displays "John"


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

// Badly written function with syntax errors!

  function greetings(name) {
    console.log(name);
    };
     
    greetings('John');


#2

You don't have a function by that name, greeting. What are the names of the function in the code you posted?


#3

Looks like I called it greetings instead of greeting!!


#4

Isn't this funny. The original code must have been 'greeting' but when I fixed the code I used 'greetings'.
I coded the function and the call with 'greetings' and the code executed properly but the code analysis code was looking only for 'greeting' so it failed the code checking process. I have always said that programmers do not need to be good with English or spelling as long as the misspell consistently!!
Thanks for your help. I appreciate your insite. (my spelling!!) John


#5

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