How to check if the URL contains a given string using JavaScript?

How to check if the URL contains a given string using JavaScript?

More to explore

Based on this image's title: “How to check if the URL contains a given string using JavaScript?