Is there a way in javascript to determine the return type(if any) of a function?
example:
function doSomething(){
return true;
}
to returned type is boolean.
example 2:
function doSomething2(x){
if(x=="a") return 1;//number
else return "bad x"; //string
}
Check what the type is:
A simple shorthand would of course be, assuming
"undefined"would be fine to return instead of"nothing returned":Example use: