9/13 Functions with two parameters, I don't understand what I missed


#1

// Write your function starting on line 3

var perimeterBox = function(2, 9, 2, 9){
return 2 + 9 + 2 + 9 ;
};
console.log( perimeterBox(11, 11) )

After I did this I got an error that stated: SyntaxError: missing formal parameter


#2

You want to make the function more universal. As it is, your function is only specific to a length of 9 and a width of 2... and the function should have only 2 parameters. Hopefully, my hints help.


#3

I don't get it, I'm so confused. -.-

var perimeterBox = function(length, width) {
return length * width;
};
var length, width = perimeterBox(3,9)
console.log(perimeterBox(3,9))

"Oops, try again. It looks like your perimeterBox function doesn't return the correct perimeter (4) for a width of 1 and a length of 1."


#4

return length * 2 + width * 2 you're working out perimeter not area.

not needed at all. remove it

should work then


#5

Ok thanks that fixed it :grin: