0
All javascript methods have a return value???
4 Answers
+ 3
Every function in JavaScript is a Function object. A function without a return statement will return a default value. In the case of a constructor called with the new keyword, the default value is the value of its this parameter. For all other functions, the default return value is undefined .
+ 1
of course.
undefined
even if you don't use "return" word
+ 1
SAN I think is better with sample code
function awesome() {}
var obj = new awesome();
var a = awesome();
"obj" has value, an instance of awesome (internally this)
"a" value is undefined.