I suspect that the if(b == true) and if(b == false) patterns aren't out of the ordinary in real-world code. I hope the default will be to initialize Booleans to false and that you'll need to opt into the other behavior.
- Josh On Fri, Jun 9, 2017 at 3:38 PM, Alex Harui <aha...@adobe.com.invalid> wrote: > Thanks for pointing it was == and not ===, but I must still be missing > something. If a variable is of type Boolean in AS (not JS), is there a > difference between these three patterns: > > If (b) > If (b == true) > If (b === true) > > Or these three? > > If (!b) > If (b == false) > If (b === false) > > I don't think there is, and so for me, I would rather not have the output > JS initialize b to false and would rather have the compiler catch were I > wrote anything other than (b) or (!b). I'd happily replace them and save > code. > > But again, I don't think we have to agree. The compiler can be taught to > respond to options to initialize everything as well detect unnecessary > code. > > Thanks, > -Alex > > On 6/8/17, 3:40 PM, "Justin Mclean" <jus...@classsoftware.com> wrote: > > >HI, > > > >> Oh. One sec. I actually just tried it in JS and I see that undefined != > >>false. That’s weird. > > > >Yep that’s the issue. > > > >Thanks, > >Justin > >