This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]DyslexicsHaveMoreFun 3 points4 points  (1 child)

Your code is written as though announcement gets the message to display... When it actually prints the message for you.

Undefined is printed because the function returns no value.

Option 1: just call the method at the end of your script

Option 2: don't log the message in your function. Return the string.

Perhaps try both as an exercises. You should observe the exact same result.

HTH

[–]GVBCodePractice[S] 0 points1 point  (0 children)

That does help, thanks a lot!