title: How can I test whether a variable has a value in JavaScript?
body: <p>I want to test whether a JavaScript variable has a value.</p>
  
  <pre><code>var splitarr =  mystring.split( " " );
  aparam = splitarr [0]
  anotherparam = splitarr [1]
  //.... etc
  </code></pre>
  
  <p>However the string might not have enough entries so later I want to test it.</p>
  
  <pre><code>if ( anotherparm /* contains a value */ )
  </code></pre>
  
  <p>How do I do this?</p>