This website collects cookies to deliver better user experience

How to check if a string is a valid URL slug in JavaScript?