Skip to main content

Aaron Heimlich

Member since Dec 11, 2008

Recent Blog Comments By Aaron Heimlich

  • Javascript Will Assign And Test A Variable In The Same Statement

    Posted on Apr 9, 2007 at 10:08 AM

    @Ben: It seems (through some experimentation on the Firebug console) that if neither b or c are truthy, then a gets set to b. var b = null; var c = false; var a = b && c // a = null var b = true; var c = false; var a = b && c // a = false... read more »

  • Javascript Will Assign And Test A Variable In The Same Statement

    Posted on Apr 1, 2007 at 12:55 AM

    Somewhat related: Instead of: var target = null; if(event.target) { // DOM2 event property target = event.target; } else { // IE proprietary event property target = event.srcElement; } Do: var target = event.target || event.srcElement; You can do this with && too: var messag... read more »

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel