Learn how to get the current URL in JavaScript using window.location.href. Complete guide with examples, URL components, and practical use cases for web development.