```
function Circle (radius) {
this.radius = radius;
this.area = function () {
return Math.PI * this.radius * this.radius;
};
this.perimeter = function(){
return 2 * Math.PI + 2 * this.radius;
}
};
i dunno whats the issue here please help? feel like im forgetting to call a function
```

# 33 Methods. Code isnt working...?

**dallaslogan**#1

**dallaslogan**#2

updated code.

function Circle (radius) {

this.radius = radius;

this.area = function () {

return Math.PI * this.radius * this.radius;

};

this.perimeter = function(){

return 2 * Math.PI + 2 * this.radius;

}

};

var circle = new Object("Circle");

var area = circle.radius;

var perimeter = circle.perimeter;

still doesnt seem to work....

**edwin0258**#3

First you create a variable holding the new Circle.

`var MyCircle = new Circle(40);`

Then you can use the methods that MyCircle inherits from the Circle constructor.

`console.log(MyCircle.area());`

**rcodeman**#4

If we know the radius then.......

**Perimeter (P) = 2 · π · R**

where:

R is the radius of the circle

π is Pi, approximately 3.142

and here

`var circle = new Object("Circle");`

what are you trying to do?you have to use `Circle`

constructor here

go to previous lessons and check how to create a new `Object`

using `constructor`

**edwin0258**#6

Try reading this https://css-tricks.com/understanding-javascript-constructors/ . Since it is on CSS-Tricks and has been reviewed by Kyle Simpson I would trust what is saying .

(Also, the perimeter change that rcodeman suggested would be a good idea)

**system**#7

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