I'm using URL utility: https://developer.mozilla.org/en-US/docs/Web/API/URL and I have a problem using it in Typescript code.
Whereas I can open the console in the browser and type:
new URL("http://stackoverflow.com/question/ask")
and the code is successful, whenever I write it in Typescript file and transpile it, I get the following error:
error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
Does it mean that this class doesn't exist in Typescript? Is there any way to use it in Typescript code?