33. Methods


#1


I am pretty sure I have the right code, but it is not working so clearly that is not the case. Please help if you can, thank you.

Error Message: There was a problem with your syntax.

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

I am not sure what I am doing wrong with the method at the bottom.


#2

Never mind I figured out I forgot a bracket whoops :grin:


#3

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


#4

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