Hi everyone, I am new to JavaScript and 3 days fresh in. I only have prior experience with Python 3 prior to this. Could anyone tell me if I have improper indentation or syntax of some sort in my code, causing for an undefined to appear.
Hello @ale_eck, welcome to the forums! The undefined
is coming from the fact that you console.log
your playGame()
function, but that function doesn’t return
anything. This means that JavaScript automatically returns undefined
, which is then printed when you log the function.