Logical Assignment Operators

Brendan Eich brendan at mozilla.org
Tue Oct 9 21:24:44 PDT 2007


On Oct 9, 2007, at 6:33 PM, Brad Fults wrote:

> Hi,
>
> As far as I can tell [1] there have never been logical assignment
> operators (AND, OR) in ES and I can't access the spec on the wiki [2]
> anymore, so I don't know if they're in the spec. I don't see anything
> in the proposals section, so here's a proposal.

Try the reference implementation when in doubt:

$ make repl
perl bin/repl-with-readline.pl
 >> a = 1
1
 >> b = 0
0
 >> a &&= b
0
 >> a
0
 >> b = "great!"
great!
 >> a ||= b
great!
 >> a
great!

/be



More information about the Es4-discuss mailing list