Help with functions


#1

How do I use functions and name them. Thanks


#2
var thisIsTheFunctionName  = function([parameter,parameter2,...]){
stuff you want to do
}

thisIsTheFunctionName([argument,argument2,...]) //to actually make it run

where the [] indicates that this part is optional. Could you be a bit more specific on what you want to do?


#3

I want to name a function


#4

I also don't understand how to use them. Whats their purpose?


#5

This means that instead of the name after var you use what you want to be the function name e.g.

var greeting = function(){}

would mean that the function's name is greeting.


#6

Ok Thanks, I figured it out.