Get The Current URL For A Browser Page In JavaScript
March 2014
Grab It
Use this to grab the URL for the current page:
const url = window..The reason to use this over document.URL is that the document version doesn't always update if an "#" anchor is added to the URL.
end of line