Hi again, very insightful to read all these great comments. "short circuit" just didn't came to my mind at the time of writing (d'oh). The example above with the 's' variable is very interesting. I'll have to investigate this one a bit further. Indeed, I should probably read a bit about bitwise operators again and there real usage, maybe it's worth using them in more cases (than my dirty hack for doing multiple statements).
And yes, "condition == true ?" is absolutely stupid. It destroys boolean thinking, I actually should have written "condition ?". Paul On Aug 21, 3:09 am, Pops <[EMAIL PROTECTED]> wrote: > > > I have to check that out. I guess it depends on the compiler > > > or intepreter. > > > It's pretty rare for anything like this to depend on the compiler or > > interpeter. > > We are still talking about short circuits? > > For bitwise conditions. It can be larged based on only compiler/ > interpreter but machine word size. This is in fact, a could be a > common bug in code: > > if (a & b) .... versus if ((a & b) == b) .... > > depending on the language compiler/interpreter, the machine word size > and the language word size. The latter is 100% guarantee to be > correct, the former, you typically is ok, but you can not be confident > that it will be. > > > Operator semantics are a pretty basic part of the core > > JavaScript language, and you should be able to count on that expression > > working the same in any JavaScript implementation. > > Is that basically because there is only one JavaScript source everyone > is using? :-) > > -- > HLS