title: What is the difference between 0/1 and true/false in JavaScript
body: <p>Recently I was trying to accomplish a feature for my app. I needed to use boolean values to turn on or off features.</p>
  
  <p>I tried this:</p>
  
  <p>.env.development</p>
  
  <pre><code>REACT_APP_IS_FEATURE_AVAILABLE = 0
  </code></pre>
  
  <p>.env.production</p>
  
  <pre><code>REACT_APP_IS_FEATURE_AVAILABLE = 1
  </code></pre>
  
  <p>features.js</p>
  
  <pre class="lang-js prettyprint-override"><code>const { REACT_APP_IS_FEATURE_AVAILABLE } = process.env
  export default {
      IS_FEATURE_AVAILABLE: REACT_APP_IS_FEATURE_AVAILABLE //
  }
  </code></pre>
  
  <p>Now assuming this is in Development mode, when I do:</p>
  
  <p>index.js</p>
  
  <pre class="lang-js prettyprint-override"><code>import Features from "./features.js";
  if(Features.IS_FEATURE_AVAILABLE) {
      return (&lt;div&gt;Markup here!&lt;/div&gt;)
  };
  </code></pre>
  
  <p>But, regardless of what the value of <code>IS_FEATURE_AVAILABLE</code> is, the <code>if</code> is always passing.</p>
  
  <p>I did figured a way out of this, and its working well and good. But I am still confused why this wasn't working.</p>
  
  <hr>
  
  <p>In response to this answer: <a href="https://stackoverflow.com/a/55720488/8349557">https://stackoverflow.com/a/55720488/8349557</a> here's what I tried:</p>
  
  <p><a href="https://i.stack.imgur.com/vSQbG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vSQbG.png" alt="comparing 0 is equal to true or not"></a></p>