Why does the console repeats itself?


#1



So the exercise requires that the console prints the perimeter, which is 4. However, the console prints two fours'. I've had this issue before but this is the first time it won't let me pass. Please help.

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


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

perimeterBox(1, 1);


#2

the codecademy console echoes the last value, can be useful once you know.

Anyway, lets look at the instructions:
Write a function called perimeterBox that returns the perimeter of a rectangle

i see a important word in this sentence: return
Your function doesn't return anything, use the return keyword


#3

Indeed, I was missing the return. Thank you so much.