This is the Bocoup web log with posts from Al, Ben, Boaz, Darius, Greg, Irene, John, Mike, Nate, Nick, Pete, Richard, Rick, Sam, Sam Clearman, Scott and Tim. You should also make sure to checkout code.bocoup.com, where we keep the finished versions of ideas we kick around here.



Jun 08, 2010

JS Truthiness

 '0' && ('0' == false)
// true

We’ll just have to agree to disagree, javascript.


Update: this is what I mean by “truthy” and “falsy”:

function truthy(x) { return !!x; };
function falsy(x) { return !x; };



Comments:




Please send your questions to this address or call Bocoup at 617-379-2752.
This web page is proudly maintained by Bocoup and hosted by (mt) Media Temple.
All code on this website is Open Source. Want to work at Bocoup? Then Apply.
HTML5 Powered with Connectivity / Realtime, CSS3 / Styling, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage