>
One can explicitly specify the type arguments of a generic function invocation or generic class instantiation in TypeScript. // TypeScript
add<number>(4, 5)
new Point<bigint>(4n, 5n)
>
The above syntax is already valid JavaScript that users may rely on, so we cannot use this syntax as-is. We expect some form of new syntax that could be used to resolve this ambiguity. No specific solution is proposed at this point of time, but one example option is to use a syntactic prefix such as : // Types Annotations - example syntax solution
add::<number>(4, 5)
new Point::<bigint>(4n, 5n)
>
These type arguments (::<type>) would be ignored by the JavaScript runtime. It would be reasonable for this non-ambiguous syntax to be adopted in TypeScript as well.----
Hmm I didn't know this, so I tried it myself in Chrome's console... sure enough it works...
new DOMPoint<Number>(4,5)
Given that the above works in the browser, what exactly is it doing? I've never seen angle brackets used that way in vanilla JS code