Difference in output


#1

What is the difference between this two code:

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

Qutput = 4 4

&

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

Qutput = 4

I think both should have the same answer...


#2

Wrote a few answers on this question here: