I can’t see where the “Undefined” output is coming from and how can I remove it and the LINK is https://www.codecademy.com/workspaces/61e1ca7dd2756881fd6d49ec
I can't see where the "Undefined" output is coming from and how can I remove it and the LINK is https://www.codecademy.com/workspaces/61e1ca7dd2756881fd6d49ec
playGame() do the logging, or change those to returns.
thank you mtf for answering
do you mean i should write playgame() and not console.log(playgame);
Correct. That way you won’t be logging the final return (or lack of).
Thank you very mtf for answering , it was really helpful insight . the undefined in the output has disappeared.
please can you explain why undefined was there because i really dont get why it was there despite the value have been put there
undefined. If the caller is logging the return, then that is what will get logged. That includes
console.log() itself, being as it too is a function.
console.log(console.log()) // undefined
This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.