Files
30-seconds-of-code/snippets/current-URL.md
2017-12-17 17:55:51 +02:00

187 B

currentURL

Returns the current URL.

Use window.location.href to get current URL.

const currentURL = () => window.location.href;
// currentUrl() -> 'https://google.com'