Hacker News new | ask | show | jobs
by nfriedly 5941 days ago
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...