Function with two parameters


#1

what if we write, it ain't working

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

perimeterBox(4,5);


#2

The code you presented is valid...
but it might be that the code-checker will give you an Oops-message
as it expects you to do as is asked in the Instructions.....


#3

as @leonhard_wettengmx_n said. The error you're receiving is based on how you presented the code, and how the console expected to read the code.

Instructions

03. One formula for perimeter is length + length + width + width;

Hopefully that will help.


#4

Thanks @leonhard_wettengmx_n


#5

thanks @lolman for help


#6

@leonhard_wettengmx_n @lolman is it necessary that we use "return" we can use "console.log" also?? for function untill and unless it's not mention to use any of them


#7

console.log(); is only for the programmer to help debug code. It wouldn't be used in a final project, so I'd get use to just using return unless the JavaScript lesson wants you to do so.


#8

@lolman ehanks buddy got it