title: How to check if a variable or object is undefined?
body: <p>I always thought I could just check an undefined var by comparing it to undefined, but this is the error I get in the chrome console :</p>
  
  <p><img src="https://i.stack.imgur.com/7JIQm.png" alt="enter image description here"></p>
  
  <p>How how do i check for the object jQuery being undefined ?</p>
  
  <p>EDIT :</p>
  
  <p><img src="https://i.stack.imgur.com/7JIQm.png" alt="enter image description here"></p>
  
  <p>if(jQuery) is giving me problems too</p>
  
  <p>EDIT :</p>
  
  <p>solution :</p>
  
  <p><code>if(window.jQuery)</code> works. 
  <code>typeof(jQuery) == 'undefined'</code> works too.</p>
  
  <p>Could anyone explain why ?</p>