I am new to JavaScript and programming in general. I am making a small script which basically gives the user a math test and grades it. My question is, how do I make a variable equal the parameter value from a function. For example:
function Function(parameter){
var var1 = parameter;
}
How do I make var1 equal the parameter passed to the function? Thanks!
Edit:
I have one more question:
Can I make a variable name equal to the parameter passed to the function? For example someone passed the parameter five to the function, could I create a variable with the name of the parameter, five?