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
That's by ECMAScript specification
13.2.1 [[Call]] ... 6. Otherwise result.type must be normal. Return undefined.
Essentially any JS function is compiled as if it has implicit return undefined; at the end:
return undefined;
function foo() { ... return undefined; // implicit non-visible statement }