Functions with two parameters - Getting two outputs?


Functions with two parameters

When I run my function, it comes out with two outputs of the same value, and brings up the error "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." What exactly is causing this?

var perimeterBox = function(l, w)


Write a function called perimeterBox that returns the perimeter of a rectangle.

Your statement doesn't return any value, it's just print result. Try instead console.log use 'return'.


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