title: What does this style of writing mean?
body: <pre class="lang-js prettyprint-override"><code>interface Counter {
      (start: number): string;
      interval: number;
      reset(): void;
  }
  
  function getCounter(): Counter {
      let counter = &lt;Counter&gt;function(start: number) {
          return start.toString();
      };
      counter.interval = 123;
      counter.reset = function() {
          this.interval = 0;
      };
      return counter;
  }
  
  let c = getCounter();
  c(10);
  c.reset();
  c.interval = 5.0;
  
  </code></pre>
  
  <p>I want to know:</p>
  
  <ol>
  <li><p><code>(start: number): string;</code> a anonymous function here? </p></li>
  <li><p>the meaning of <code>&lt;Counter&gt;</code> in</p>
  
  <pre><code>let counter = &lt;Counter&gt;function(start: number) {
    return start.toString();
  };
  </code></pre></li>
  <li><p>I don't understand what <code>c</code> is in <code>let c = getCounter()</code>;</p>
  
  <p>It's not a object , not a class , and its type is <code>Counter</code> which means a <code>interface</code> (but why assigned to a function?) So is <code>c</code> an instance of Counter? And the interface is equal to function?</p></li>
  </ol>