Build a Library NaN instead of a number

Hello,

I am having trouble figuring out what I am doing wrong in this project as the result it gives me is Nan and not a number? Any help welcome!

Thanks,
Kati

1 Like

Hi there.

You have a typo in your getAverageRating() function. :slight_smile:

Fairly sure your ratings array doesn’t have a property called “legth”. :slight_smile:

Oh haha, you’re right! Thanks for pointing this out. Works ok now!

1 Like

No problem. Sometimes the little errors are the hardest to spot on your own, especially if you’ve been staring at the same code for a while. :smiley:

1 Like

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