Created
May 24, 2022 01:14
-
-
Save ajmeese7/b55a3d92e2c86f50a9e766ebc481ccaf to your computer and use it in GitHub Desktop.
Gets the root of a domain from a URL in JavaScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const baseURL = (url) => url.split("//")[1].split("/")[0]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment