Don't understand why at the end it shows undefined

Hi! Can someone help me understand why I can’t get rid of undefined at the end? Here is a link: Codecademy export · GitHub

Because you have a console.log in a console.log. The function that you call does not have a return value and if you log a function call that does not have a return value, it logs ‘undefined’. Change the console.log() in your function to a return statement and then log the function call as you already do.

1 Like

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