Hacker News new | ask | show | jobs
by aristus 5930 days ago
Ah! I will verify and correct. Thanks.
1 comments

JavaScript is weird about truthyness / falsyness of arrays:

  if([] == false){
    // this code runs
  }

  if( [] ) {
    // this code also runs
  }

  if([] == true){
    // this code doesn't run
  }
From http://nfriedly.com/techblog/2009/06/advanced-javascript-ope...