This snippet returns the current URL.
const currentURL = () => window.location.href; currentURL(); // 'https://medium.com/@fatosmorina'