What does enclosing a class in angle brackets "<>" mean in TypeScript?
<p>I am very new to TypeScript and I am loving it a lot, especially how easy it is to do OOP in Javascript. I am however stuck on trying to figure out the semantics when it comes to using angle brackets.</p>
<p>From their docs, I have seen several examples like</p>
<pre class="lang-ts prettyprint-override"><code>interface Counter {
  (start: number): string;
  interval: number;
  reset(): void;
}

function getCounter(): Counter {
  let counter = &lt;Counter&gt;function (start: number) { };
  counter.interval = 123;
  counter.reset = function () { };
  return counter;
}
</code></pre>
<p>and</p>
<pre class="lang-ts prettyprint-override"><code>interface Square extends Shape, PenStroke {
  sideLength: number;
}
  
let square = &lt;Square&gt;{};
</code></pre>
<p>I am having trouble understanding what this exactly means or the way to think of/understand it.</p>
<p>Could someone please explain it to me?</p>