9. Functions with two parameters


#1

Hey, i've just started coding and i'm stuck at 9, functions with two parameters.
I don't really see where i've gone wrong, could any of you help me?

// Write your function starting on line 3

var perimeterBox = function(lenth, width)
{
return length + length + width + width;
};
perimeterBox(2,2);

I keep getting this response : 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.

What am I doing wrong?


#2

You accidentally spelled "length" wrong! :slight_smile:


#3

oh! thank you! I should have noticed that, i feel dumb :confounded:


#4

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


#5

Where did I go wrong?
var perimeterBox = function(width, length) {
return length + length + width + width;
};
var perimeterBox(7,24);


#6

Hi this line

var perimeterBox(7,24);

remove the var.