Followed Matts tutorial and can't get a value to return

In the intermediate JavaScript course there in a vide on how to create a library with Media, Books and Movies. I have followed the instructional video, but the getAverageRating method just returns [Function: getAverageRating] instead of a value. Has anyone else run into this issue?

What does your code look like? It looks like you’re returning the function itself instead of the function call.

So if i have a function foo()

if i

return foo;
// returns the function

it’s very different from

return foo(); 
// invokes the function
1 Like

That was it! Sometimes I miss the simplest of things!

THANK YOU SO MUCH. THIS WAS DRIVING ME CRAZY!!! :stuck_out_tongue_winking_eye: