title: What should I return when object is not found in TypeScript using strict mode?
body: <p>Here's the snippet of code in typescript with <code>strictNullChecks: true</code></p>
  
  <pre><code>getItem(key: string): T {
      let index: number = this.contains(key); // returns -1 if not found
      if (index === -1) {
          return null; // error null is not assignable to type 'T'
      } 
      return this.map[index].value;
    }
  </code></pre>
  
  <p>As you can see I can't return null when I didn't find element because of a compilation error:</p>
  
  <blockquote>
    <p>error 'null' is not assignable to type 'T'</p>
  </blockquote>
  
  <p>What should I return instead of null? What is the best practice?</p>