title: How to check both defined and parameter passed with JavaScript?
body: <p>I have that function:</p>
  
  <pre><code>function(stringsVar) {
  var stringRes = stringsVar || localize_en;
  if('window.'+stringsVar === undefined) {
      stringRes = localize_en;
  }
  ...
  }
  </code></pre>
  
  <p>and doesn't work. That was like that actually:</p>
  
  <pre><code>function(stringsVar) {
      var stringRes = stringsVar || localize_en;
  }
  </code></pre>
  
  <p>that function can take a parameter or not and the code above is checking it correctly. Parameter of that function will be a variable. I want to add that ability to my function. It will check whether that variable is defined or not. If not there is a defined variable at system, localize_en, it will be assigned as default.</p>
  
  <p>How can I correct my code. The second part of my code will be that functionality:
  i.e stringsVar is localize_ar and it is not a defined variable (I define that kind of variables with var keyword)</p>
  
  <pre><code>if(window.localize_ar === undefined){
  alert('yes');}
  else {
  alert('no');
  }
  </code></pre>
  
  <p>I will add that functionality as parametric.</p>
  
  <p>Any ideas?</p>
  
  <p><strong>PS:</strong> localize_en and something like that variables are object.</p>
  
  <p><strong>EDIT:</strong> I am working on JQuery localizer plugin => <a href="http://plugins.jquery.com/files/sagimann.localizer.js__0.txt" rel="nofollow">source code</a>. 
  I call it as</p>
  
  <pre><code>$('html').localize('localize_' + tr);
  </code></pre>
  
  <p>However it can not understand it as an object, it works as if I do:</p>
  
  <pre><code>$('html').localize(localize_tr);
  </code></pre>
  
  <p>It changes it into a string maybe the problem lays on there?</p>