The window.location read-only property returns a location object with information about the current location of the document.

Example: window.location.href

This method returns the origin of the current location, composed of protocol, host & port (if exists).


// Output:

That’s it in this #quick KB.
Thank you for reading. Happy Coding..!!

Leave a Reply