It's not making any sense!


#1


https://www.codecademy.com/courses/javascript-beginner-en-6LzGd/2/1?curriculum_id=506324b3a7dffd00020bf661#


I get an error message saying this: 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, even though the box says 4 (the box where the code shows when you click Save and Submit Code). The instructions also say that I can do whatever I want with the perimeter, and this says otherwise as you can see. Where did I go wrong?!


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


#2

why would you give your function 4 parameters, look:

length = 1
width = 1
perimeter = length + length + width + width

see how you can simply use a variable twice? Same goes for function parameters


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.