Is this a bug or am I missing somthing?


#1


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

I get the error message like 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.

But I have passed the values of 1 and 1 into my function and it does indeed return 4. So as far as I can see my function is working correctly so I am wondering if this is a bug. Has anyone else experienced this?


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


#2

It doesn't return 4. It prints 4, but that's something else. (recognition doesn't mean it's correct)


#3

Thank you for clarifying. I now understand what it wants from me and have corrected the code.

function perimeterBox(width, length){

var perimeter = width + width + length + length;
return perimeter;

}

console.log(perimeterBox(1,1));


#4

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