HN user

slurpme

20 karma
Posts2
Comments5
View on HN

Yes I think you are right about that, too early in the morning for me...

Makes me wonder what the rules are for coercion though, that is does it pick null to coerce or 0?

I know, I mentioned it as the new object because it's one of the few situations I know of where you might use a newline after the return keyword.

I understand what you mean, in this case though it would be helpful if the interpreter detects the statement as being not reachable since it's after the return.

How about this surprise which caught me out a couple of days ago, try:

function hello () {

    return
    {
       value : 10
    };
}

window.alert (hello ().value);

It burps in FF and IE...