title: TypeScript Type of generic function
body: <p>I can't get my head arround the following paragraph in the TypeScript documentation:</p>
  
  <p>"The type of generic functions is just like those of non-generic functions, with the type parameters listed first, similarly to function declarations:"</p>
  
  <pre><code>function identity&lt;T&gt;(arg: T): T {
      return arg;
  }
  
  let myIdentity: &lt;T&gt;(arg: T) =&gt; T = identity;
  </code></pre>
  
  <p>What does the last line do and why is it used?</p>
  
  <p>As far as I understood, myIdentity is a variable which gets the type of the identity function? And if this is the case why do I need to define such a variable? The function identity already declares what return type I can expect.</p>