I need some help on the Functions and loops


#1


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


// Write your function starting on line 3

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


#2

I believe you made a code for the area and not the perimeter. Perimeter is the sum of all the lengths and widths.


#3

Okay, thanks that helped a ton. It was kinda simple now that I see what was wrong haha.


#4

No problem! I made a typo before-- it should say widths (i fixed it). Have a great day and happy coding.


#5

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