title: Generics in TypeScript what makes them useful
body: <p>I was reading this article from Eric Elliot:</p>
  
  <p>“You Might Not Need TypeScript (or Static Types)” @_ericelliott <a href="https://medium.com/javascript-scene/you-might-not-need-typescript-or-static-types-aa7cb670a77b" rel="nofollow noreferrer">https://medium.com/javascript-scene/you-might-not-need-typescript-or-static-types-aa7cb670a77b</a></p>
  
  <p>He talks about this TS function</p>
  
  <pre><code>function identity&lt;T&gt;(arg: T): T {
    return arg;
  }
  </code></pre>
  
  <p>What is the <code>&lt;T&gt;</code> syntax for? I believe it's for generics but I don't really understand the purpose.</p>
  
  <p>Why doesn't the fact that <code>arg</code> is declared as type <code>T</code> take care of everything?</p>