3/13 Function Syntax


I am having trouble with syntax.

In this example:
var sayHello = function (name){
console.log ("Hello " + name};


Does the keyword 'var' declare the function or does the keyword 'var' declare a variable?
And 'sayHello' is the name of the function?


2 posts were merged into an existing topic: Declaring Function and Variables and giving it a name


The keyword var declares a variable.

A function, in JavaScript, is assignable in the same way but you must use the function keyword to make it a function.


i am having the same problem



See my reply.


'var' declares a variable (variable). 'function(argument)' declares the function by assigning it to the variable.


i dont understand this part of functions


I don't understand when the comment says "call the greeting function".


I still dont get it sorry