title: Converting boolean integer to string value in javascript
body: <p>I am reading a boolean integer value from database (0 or 1).
  Is there an simple solution to convert a boolean int to boolean string?</p>
  
  <p>When I was saving the value to my database I was able convert the string to an int using a javascript ternary operator.</p>
  
  <pre><code>var i = result ? 1 : 0;
  </code></pre>
  
  <p>Is it possible to preform the opposite?</p>
  
  <p>My current work-around is:</p>
  
  <pre><code>function boolIntToString(i) {
      if (i == 1) {
          return true;
      }
      else {
          return false;
      }
  }
  </code></pre>