JSFiddle - React, Tailwind, and code Playground
JavaScript
try {
const url = new URL('http**://example.com');
} catch (error) {
console.log(error); // => TypeError, "Failed to construct URL: Invalid URL"
}
try {
const url = new URL('http**://example.com');
} catch (error) {
console.log(error); // => TypeError, "Failed to construct URL: Invalid URL"
}