title: Checking for Undefined in Javascript
body: <p>I was following the below logic to check if a variable is undefined or not:</p>
  
  <pre><code> if (variable==undefined){
  ////implementation
  }
  </code></pre>
  
  <p>But found that for some cases it did not function as expected. So, tried this approach, </p>
  
  <pre><code>if(typeof(variable) == "undefined"){
  /////implementation
  }
  </code></pre>
  
  <p>So which one is most reliable?</p>