33 - TypeError and not properly defined?


#1

So my current error raises this: I dont understand, because perimeter should be defined. I am not understanding the error that my code is raising.

Your code caused a TypeError when trying to call .perimeter(). Make sure
you have properly defined the perimeter method. Use the .area() method
as a guide. Here's the error message: TypeError: c.perimeter is not a
function

function Perimeter (radius) {
    this.radius = radius;
    this.perimeter = function(){
            return Math.PI * this.radius * 2;        
        };
}

#2

but this is the code you start with:

function Circle (radius) {
    this.radius = radius;
    this.area = function () {
        return Math.PI * this.radius * this.radius;
        
    };
    // define a perimeter method here
    
};

Circle is your object. Then you are told to add a perimeter method to circle, but then you rename your object and your area method is gone?

There is even a comment telling you where to add the method


#3

wait no, never mind, after staring at it I got it. Whoops. Sorry about that!


#4