When reading TypeScript handbook, I came across following example:
interface Shape {
color: string;
}
interface Square extends Shape {
sideLength: number;
}
var square = <Square>{};
square.color = "blue";
square.sideLength = 10;
The question is - what is actually <Square>{}? Seems like a bizarre syntax to me. From Java/C# point of view, it's like a generic of an anonymous object. What exactly is it and what are the limitations of such creation?