Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTomasz Grodzki
8,130 PointsWhy there's no change in dueDate, book and currentBook properties?
I have written some code and I saw that some properties aren't changing.
But well... In code that we get from Ahley, properties also aren't changing. Take a look at console log... At Book's dueDate and patron properties and Patron's currentBook property after checkOut(). There's still 'null' value. Why is that?
1 Answer
Steven Parker
231,248 PointsYou're probably examining live references in the dev tools, and the states have already changed back before you can examine them.
Try logging out the specific property you want to see changing, for example:
patron.checkOut ( book );
console.log ( book.patron ); // log the specific property to see it set
patron.returnBook ( book );
console.log ( book.patron ); // and now cleared again
Tomasz Grodzki
8,130 PointsTomasz Grodzki
8,130 PointsExactly, that was a problem. Thanks for help!