My code seems fine


#1


https://www.codecademy.com/courses/spencer-sandbox/5/4?curriculum_id=506324b3a7dffd00020bf661#


SyntaxError: missing } after function body


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


#2

Hi, you forgot to close the } just after the line 4.
Try this.

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

#3

It says: When trying to create a new Circle the following error was thrown: ReferenceError: radius is not defined


#4

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