The following doesn't work as I would expect it to:
function test()
{
// Returns undefined, even though I thought it would return 1
return
1;
}
Apparently, the value should be on the same line: return 1;
. Why can I write things like
// Assigns 1 to foo just fine
foo
=
1;
...but the return
statement doesn't work the same way?