Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
Ben Nadel at CFinNC 2009 (Raleigh, North Carolina) with: Simon Free and Todd Sharp and Shannon Hicks and Charlie Arehart and Sean Corfield and Jason Dean
Ben Nadel at CFinNC 2009 (Raleigh, North Carolina) with: Simon Free@simonfree ) , Todd Sharp@cfsilence ) , Shannon Hicks@iotashan ) , Charlie Arehart@carehart ) , Sean Corfield@seancorfield ) , and Jason Dean@JasonPDean )

Chris

Member since Jul 12, 2012

Recent Blog Comments By Chris

  • Javascript's Implicit Boolean Conversions

    Posted on Jul 12, 2012 at 7:05 AM

    You are right I think not false is true - since boolean logic means !false => true ;) As I wrote before a boolean evaluation of a string is different to the evaluation of a boolean. You cannot really compare a different datatype to a boolean (except of 0,1,'0','1') like you can compare a string ... read more »

  • Javascript's Implicit Boolean Conversions

    Posted on Jul 12, 2012 at 3:22 AM

    @Iulian: Your 2nd test ('true'?1:2) throws the true because it is just not false. You could write everything in the string (eg 'yourteststring'?1:2 or even 'false'?1:2). Every string that is not empty is not false. It is evaluated like this 'something'.length?1:2 so with this you can perfectly test ... read more »