title: avoid errors if one of variable undefined all script stop working
body: <p>my problem Confined to missing a value of a variables </p>
  
  <p>users can put values of this vars</p>
  
  <pre><code>var name = "name";
  var age = "age";
  var sex = "sex";
  var weight = "weight";
  </code></pre>
  
  <p>if one variable is not defined ,it make all script stop what's the best ways to avoid this error have atrying with </p>
  
  <pre><code>switch (variable){
  default:
  //codes
  breake;
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>    switch (variable){
      case undefined:    //codes
      breake;
      }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>if(typeof variable==='undefined'){
  //do that
  }
  </code></pre>
  
  <p>need to more Tips and Advice in this cases Especially if we have big code blocks ..please share your experience for intermediate learner</p>
  
  <p><strong>note</strong> : simply my code for users contains vars with external script.js embeded</p>