title: checking for invalid javascript function parameters
body: <p>If i need to check a parameter i do this.</p>
  
  <pre><code>if ((typeof param == 'undefined') || (param == null)){
      param = ''; //or param = false;
  }
  </code></pre>
  
  <p>And if it's meant to be a number i might throw in a <code>isNaN</code> check too. I was just wondering if there were any other things i should check for or what you do if you need to check your parameters. I know javascript has a lot of quirks that could affect something like this. What is good practice to check for?</p>
  
  <p>Thanks</p>