Build The library in learn classes

this is classes course of building the library (JavaScript) https://www.codecademy.com/paths/web-development/tracks/webdev-intermediate-javascript/modules/learn-javascript-classes/projects/build-a-library

I got a typeError with the push property and I can’t find my mistake. please help me find the problem ^^

/home/ccuser/workspace/learn-javascript-classes-build-a-library/app.js:29
this.ratings.push(value);
^

TypeError: Cannot read property ‘push’ of undefined
at Book.addRating

here is the code

Your constructor has a capital c (but javascript is a sneaky fox that doesn’t let you know that …). I figured it out because I was trying to interact with your object (just asking for the title for example) and it wasn’t giving me anything.
It’s good to test objects before adding complexity because otherwise the debugging gets more obscure later.

Here’s a chapter on objects and classes, getters/setters from Eloquent Javascript, may help:
https://eloquentjavascript.net/06_object.html

Welcome to the forums :slight_smile: !

Thanks! I was really struggling to look find for that error.
I’ll do that, it gets really tricky to debug those kinds of errors as you said.