Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
I am the chief technical officer at InVision App, Inc - a prototyping and collaboration platform for designers, built by designers. I also rock out in JavaScript and ColdFusion 24x7.
Meanwhile on Twitter
Loading latest tweet...
Ben Nadel at BFusion / BFLEX 2009 (Bloomington, Indiana) with: Dan Wilson

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 »