undefined. Using the implicit return value from such a function
is not an error in itself, but it is a pattern indicating that some
misunderstanding has occurred.
Do not use the return value from a function that does not return an expression.
In the example below, the function
renderText is used to render
text through side effects, and the function does not return an expression.
However, the programmer still uses the return value from
renderText as if the function returned an expression, which is
clearly an error.
The program can be fixed either by removing the use of the value returned by
renderText, or by changing the
to return an expression.
- Mozilla Developer Network: Return.