Function
Check if a URL is valid
The URL to check
True if the URL is valid, false otherwise
isURL("https://www.example.com"); // trueisURL("http://example.com/path"); // trueisURL("www.example.com"); // false (missing protocol)isURL("not a url"); // false Copy
isURL("https://www.example.com"); // trueisURL("http://example.com/path"); // trueisURL("www.example.com"); // false (missing protocol)isURL("not a url"); // false
Check if a URL is valid