JSFiddle - React, Tailwind, and code Playground
HTML
<h1>
</h1>
JavaScript
let text = "";
try {
text = new URL(`https://"google.com`).toString();
}
catch (err) {
text = err.toString();
}
document.querySelector('h1').innerHTML = text;
<h1>
</h1>
let text = "";
try {
text = new URL(`https://"google.com`).toString();
}
catch (err) {
text = err.toString();
}
document.querySelector('h1').innerHTML = text;