My result is printing out twice and I d


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
9. Functions with 2 parameters

<In what way does your code behave incorrectly? Include ALL error messages.>
It saying my perimeterBox did not return the correct value of 4 - it did, it just returned it twice

```

Replace this line with your code.

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

<do not remove the three backticks above>

#2

Actually, the error message is correct. Your function does not return anything, only logs it. When the lesson checker runs the program it logs again, that’s the second output you are seeing.

    return 2 * ( length + height );

will return the value, not log it. if you want it to print, log the call expression.

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

A question of coding