Lesson 101: greetTarget Function Returns Undefined #9

Closed
opened 2026-04-26 15:37:52 +00:00 by enjin2310 · 2 comments

greetTarget('Dennis') expected 'Salutations, Dennis!' but got 'undefined'
greetTarget('Dennis') expected 'Salutations, Dennis!' but got 'undefined'

Output:

Unknown error occurred.

greetTarget('Dennis') expected 'Salutations, Dennis!' but got 'undefined' greetTarget('Dennis') expected 'Salutations, Dennis!' but got 'undefined' Output: Unknown error occurred.
Owner

ahh this is just an issue with what you're returning, you're trying to return the result of console.log("some text") and it just wanted you to return "some text" -- I could make the error much more helpful

ahh this is just an issue with what you're returning, you're trying to return the result of console.log("some text") and it just wanted you to return "some text" -- I could make the error much more helpful
Owner

Triage: Expected behavior -- Lesson 101 instructs the student to write a greetTarget function. The undefined return is the expected result when the student hasn't completed the function body yet. The lesson's test cases validate the completed implementation. No code defect found.

**Triage: Expected behavior** -- Lesson 101 instructs the student to write a `greetTarget` function. The `undefined` return is the expected result when the student hasn't completed the function body yet. The lesson's test cases validate the completed implementation. No code defect found.
Sign in to join this conversation.