Why is my function returning undefined when I have not mentioned that anywhere.
The crux of the issue is in the topic header.
All functions have to return something. If nothing is specified, they return undefined
.
|
|
You may however chose to ignore receiving something from the function.
|
|
Typically, I like to return at least a true
or false
- just for the heck of it. That’s overengineering to some, but that’s ok.
|
|