[Flashcoders] undocumented || usage

2006-12-21 Thread Steven Sacks | BLITZ
Saw this recently in code and was surprised that it worked but it's pretty cool. a = foo; b = bar; c = a || b; trace(c); -- foo a = 0; // or a = ; // or a = false; // or a = null; // or a is undefined b = bar; c = a || b; trace(c); -- bar It will return b if a is an empty string, false, null,

Re: [Flashcoders] undocumented || usage

2006-12-21 Thread eka
Hello :) if you test this code you can understant easily this feature : 1 - first example var a = toto ; var b = (a != undefined) ; if ( b ) { trace(a exist : + a) ; } 2 - second exemple var a = toto ; if ( a ) { trace(a exist : + a) ; } You can show the variable a in a

Re[2]: [Flashcoders] undocumented || usage

2006-12-21 Thread R�kos Attila
SSB a b -- returns true if a and b are both true, false otherwise By my tests a b returns b if a and b are both resolves true. If a and/or b resolves false then it returns that value, which is first resolves false: if a is false and b is false = a if a is false and b is true = a if a is true