title: TypeScript converts boolean to string
body: <p>I have the following problem: within the following code, I'm trying to check, if the variable result is true or false:</p>
  
  <pre><code>    const result: boolean = await this.sqlConnector.validatePassword
          (this.userData.getUserId(), validatorContext.recognized.value);
      // Returns string
      console.log(typeof(result));
  </code></pre>
  
  <p>The function <code>sqlconnector.validatePassword</code> is also returning a boolean. The header of the function looks like that:</p>
  
  <pre><code>public validatePassword (userId: string, userInput: string): Promise &lt;boolean&gt; 
  </code></pre>
  
  <p>However, the <code>typeof(result)</code> function is saying, that the variable is from type string.
  This finally leads to the fact that the following if statement always fails.</p>
  
  <pre><code>    // always false because no boolean
      if (result === true) {
          return true;
      } else {
  </code></pre>
  
  <p>What is the reason for this?</p>