33. Methods

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?


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.


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