var currentURL = window.location.href;
This code line defines a variable called “currentURL” and assigns it the value of the current web page’s URL.
get current properties
Another way to get the current properties of an object is to use the Object.keys() method. This method returns a list of all the keys (or unique identifiers) of an object. You can then use the key name as a variable to access the value associated with that key.