23. Private Variables


#1



https://www.codecademy.com/courses/objects-ii/4/2?curriculum_id=506324b3a7dffd00020bf661


Im not sure why I am wrong can you please help it says
Oops, try again. Make sure to create john using the Person constructor


function Person(first,last,age) {
   this.firstname = first;
   this.lastname = last;
   this.age = age;
   var bankBalance = 7500;
}

// create your Person 
function Person(first,last,age) {
   this.firstname = John;
   this.lastname = Skellington;
   this.age = 989;
   var bankBalance = 8000;
}


// try to print his bankBalance


#2

remember when you created jack/me with the person constructor?

var me = new Person("Jack", 18);

This is exactly the same, except this time he is called john. Then you need to add the property's to john using the dot notation:

john.firstname = "John"

and so on


#3

Now it says john isn't defined now what
function Person(first,last,age) {
this.firstname = first;
this.lastname = last;
this.age = age;
var bankBalance = 7500;
}

// create your Person
function Person(first,last,age) {
john.firstname = "John"
john.lastname = "Skellington";
john.age = 989;
john.bankBalance = 7500;
}

// try to print his bankBalance


#4

below // create your Person, it shouldn't be a function, you should just create a new person:

var john = new Person('John','Smith', 30);