// Write your function starting on line 3

var perimeterBox = function(3, 9) {

return 3 + 3 + 9 + 9;

}

**What am I doing wrong?**

// Write your function starting on line 3

var perimeterBox = function(3, 9) {

return 3 + 3 + 9 + 9;

}

**What am I doing wrong?**

First of all read the instructions

- Write a function called perimeterBox that returns the perimeter of a rectangle.
- It should have two parameters.
- One formula for perimeter is length + length + width + width;
- Call the function and pass in any value for length and width you like.

Than look at your code

```
// Write your function starting on line 3
var perimeterBox = function(1, 1) {
return 3 * 5;
}
```

Where is the Formular for a Perimeter?

Where do you call your function?

Why do you try to give paramter with name "1" and "1" better would be lenght and width

And please dont edit your code after asking

```
var add = function(a, b) {
return a + b;
}
add(1,2);
```

Return is 3

This should help you to think about your code.

I could give you the right Syntax but than you didnt learn anything.

Here is my code, and it is correct:

// Write your function starting on line 3

var perimeterBox = function(a, b) {

return a + a + b + b;

}

perimeterBox(2, 3);

Thank you!

I thought I needed a number or string

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