23. Private Variables


#1


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


Oops, try again. It looks like you didn't try to print john's bankBalance!, I do not understand.


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

// create your Person 
var john = new Person("John Green", 75);
var bankBalance = john.bankBalance;


#2

Do you remember how to print something in javascript?
are you doing that?


#3

???I don't understand


#4

It says to print something.
You're not printing anything, there is no instruction in your code which has the effect of printing


#5

I figured it out
console.log(john.bankBalance);


#6

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