Not properly calling function


#1

So I'm trying to learn functions. This is my code,

var sayHello = function(name) {
console.log("Hello" + " " + name);
};
sayHello("Emily")

Now, this code does what it's supposed to. It prints out "Hello Emily". But the page is telling me I'm not calling my function- or rather the exact words are "Oops, try again. You did not call the greeting function. Pass it a name!"

Been racking my brain with this for an hour.


#2

Never mind, sorry. As soon as I posted this I had an idea- I changed the name of the function to 'greeting' and it accepted it. Guess it wasn't a problem with my code at all.


#3

Hi @byteslayer06219,

As the error message says, you need to define and call the function greeting, currently you are using sayHello.