Current URL
JavaScript, Browser · Oct 20, 2020

Returns the current URL.
- Use
Window.location.href
to get the current URL.
const currentURL = () => window.location.href;
currentURL(); // 'https://www.google.com/'
JavaScript, Browser · Oct 20, 2020
Returns the current URL.
Window.location.href
to get the current URL.const currentURL = () => window.location.href;
currentURL(); // 'https://www.google.com/'
Working with URLs is an essential skill for web developers. This snippet collection covers all the necessary resources to master URLs in JavaScript.
Collection · 12 snippets
Creates an object containing the parameters of the current URL.
JavaScript, Browser · Oct 22, 2020
Prefixes a CSS property based on the current browser.
JavaScript, Browser · Oct 22, 2020