11. class is in session


#1

function Person(name,age) {
this.name = name;
this.age = age;
}

// Let's make bob again, using our constructor
var bob = new Person("Bob Smith", 30);
var susan = new Person("Susan Jordan", 35);

// make your own class here
Circle (radius) {
this.radius = radius;
}

var Circle = function(radius) {
this.radius = radius;
}

Can anyone explain me what I'm doing wrong? It keeps saying: Oops, try again. There was a problem with your syntax.


#2

This doesn't need to be in your code

And here you are creating an object so you should write,

function Circle (radius) {

#3

Which part do you mean?


#4

The line that has this code, should not be part of your code.

And here,

Should be written like this,

function Circle(radius) {

#5

Thank you. I think I need to practice more with this part.


#6

Has it worked though? :slight_smile:


#7

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