title: Typescript - Type 'string' is not assignable to type 'boolean'
body: <p>I have following typescript code:</p>
  
  <pre class="lang-js prettyprint-override"><code>const parentItem= this.links.find((link) =&gt; {
    return urlArr.find((urlWord) =&gt; {
      return !!(urlWord === link.route.split('./')[1])
    })
  });
  
  // link.route.split('./')[1] is a string
  // urlWord is also a string
  // urlArr is array of strings
  // links is an array of objects
  </code></pre>
  
  <p>and typescript keeps on complaining:</p>
  
  <blockquote>
    <p>.component.ts(11,59): error TS2322: Type 'string' is not assignable to type 'boolean'.</p>
  </blockquote>
  
  <p>The code works fine in chrome console.</p>
  
  <p>This may look like similar to this <a href="https://stackoverflow.com/questions/45246638/angular-type-string-is-not-assignable-to-type-boolean">question</a> but even after reading it I couldn't figure out where the problem is.</p>