Instead of relying on Javascript's prototype
, I am considering utilizing the inheritance feature of Typescript.
My goal is to incorporate some helpful methods in the class String
within my designated namespace Util
. This way, the String
class can implement the global interface String
.
How can I distinguish between these two entities? For instance, in C++, we typically use:
namespace Util
{
class String : public ::String { ...
Is there a Typescript equivalent for ::
that signals to the compiler the interface's affiliation with the global scope?
Add-on Question: Is class inheritance the best substitute for Javascript's prototype
?
What serves as a comparable alternative to Javascript's "prototype" in Typescript?