statements that could be expressions?

Peter Michaux petermichaux at
Wed Jun 1 16:07:15 PDT 2011

Could some of JavaScript's statements also be allowed as expressions?

In Perl there is the common idiom when opening a file

  open F, "< $f" or die "Can't open $f : $!";

In JavaScript could "throw" be an expression?

  f() || throw 'f failed';

Could JavaScript's "if" become an expression? (I know JavaScript the
?: operator but this is just a for example.)

Could a Block statement also be an expression like Scheme's "begin"?


More information about the es-discuss mailing list