If you place a carriage return after a 'return' statement in Javascript, and put some code on the line underneath, the function returns 'undefined', as if the statement was simply:
return;
Here's an example of a function that returns 'undefined':
function whatelse() { var ok = false; return // function ends here ok ? 'OK (true)' : 'OK (false)'; // this line is never executed! }
No comments:
Post a Comment
Note: only a member of this blog may post a comment.