title: Why is == working but not === if the console.log is null?
body: <p>general javascript question please. </p>
  
  <p>I have a button which will flag whether a user wants to share a post to facebook or not. When clicked, it will check if a user already has a facebook token or not. And also, whether the token is valid.</p>
  
  <p>If either is not true, it will prompt the user to signin to facebook.</p>
  
  <p>Right now the code works just fine. But for a long time I was doing if(facebookToken === null)</p>
  
  <p>and it was ignoring it. Only until I switched to == did it work.</p>
  
  <p>Why is this? I'm console logging it and it was coming back as null</p>
  
  <p>This is my code that works:</p>
  
  <pre><code>  shareToFacebookPress() {
      const timeNow = Date.now();
      const facebookToken = this.props.facebook_token;
      console.log(facebookToken);
      const facebookExpiry = this.props.facebook_token_expiry * 1000;
      console.log(facebookExpiry);
      if (facebookToken == null || facebookExpiry &lt; timeNow) {
        console.log("doesn't exist");
        this.props.signInFacebook();
      } else {
        this.state.shareToFacebook ?
        this.setState({ shareToFacebook: false }) :
        this.setState({ shareToFacebook: true });
      }
    }
  </code></pre>
  
  <p>Surely <code>===</code> direct comparison, so if I’m console loggin the value and getting back <code>null</code>, surely it <code>if(value === null)</code> should equate to true?</p>
  
  <p>This seems to be an impossibility. What’s happening here?</p>
  
  <p>if <code>value</code> console logs to <code>null</code> and I do <code>if(value === null)</code> why doesn’t that equate to <code>true</code>?</p>
  
  <p>Surely if it’s console logging <code>null</code> then it has to be it?</p>
  
  <p>It’s not coming back as <code>"null"</code>, which would make sense if I was using <code>==</code></p>