33. Methods


#1
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;
};

Where I'm making wrong? Please anyone help me?


#2

Please format your post as I have done (select entire code block; press Ctrl+Shift+C) from next time. Thanks! :smile:

You haven't posted the error you got. But, I can guess that you are missing a right brace } in the last line.


#3

Thanks buddy! you got me! Its executed! :grinning: