Function with two parameters


#1



var perimeterBox=function(length,width){
return length+length+width+width;
};
var =function();
console.log("perimeterBox");


Replace this line with your code.


#2

The above line may be removed. It is throwing an exception.

A function call expression looks like this:

myFunction();

To log the return value, we can save it then log the saved value, or simply log the expression, itself.

console.log(myFunction());

In the exercise above, the function has two parameters, so our call expression needs to have two arguments to pass in to the function. Their values will be stored in the locally defined variables, length and width.

console.log(perimeterBox(7, 11));    // 36

#4