4 ms·
If you're writing browser JS, just use the URL builtin const isValidUrl = urlString => { try { new URL(urlString); return true; } catch {
by toomanybeersies 5y ago
If you're writing browser JS, just use the URL builtin
const isValidUrl = urlString => {
try {
new URL(urlString);
return true;
} catch {
return false;
}
};