I need some help on the Functions and loops


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;


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


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


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


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