1export const domainFromURL = (url) => {2 return url3 .replace("http://", "")4 .replace("https://", "")5 .replace("www.", "")6 .split(/[/?#]/)[0];7};
Written byAbhith Rajan Follow @AbhithRajan
Abhith Rajan is a software engineer by day and a full-stack developer by night. He's coding for almost a decade now. He codes 🧑💻, write ✍️, learn 📖 and advocate 👍.
Connect