Readme

Check if a URL is valid

Returns true if a URL is valid and false if not

1
2
3
4
5
6
7
8
9
export let isValidURL = (maybeURL) => {
try {
new URL(maybeURL);
return true;
}
catch (e) {
return false;
}
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023