Ask coding questions

← Back to all posts
Why it's printing the value though I'm not using console.log() function?
h
SAMSIL

I don't know why it's printing the return type of greet() function. It should return the value not to print in the terminal.

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
SAMSIL
Comments
hotnewtop
Coder100

replit automatically prints the value of the final statement of the code. So it would print a.greet() to fix this, add this to the END (last line) of your code:

SAMSIL

@Coder100 Thanks for the answer. Greatly appreciate your help.

Coder100

np! @SAMSIL