I\'m taking a course in JavaScript programming, and the instructor said that a typical JavaScript function always returns a value. Even when we don\'t provide any explicit r
Even when we don't provide any explicit return value, the engines return "undefined". Is that true?
Not really. As I understand it, a function that returns nothing...returns nothing. That said, if you assign a variable to the result of such a function invocation, then the expression will evaluate to undefined.
EDIT
I stand corrected. Here's the relevant portion of the spec:
13.2.1 [[Call]]
When the [[Call]] internal method for a Function object F is called with a this value and a list of arguments, the following steps are taken: