Files
30-seconds-of-code/snippets/current-URL.md
2017-12-17 11:55:13 +01:00

162 B

Current URL

Use window.location.href to get current URL.

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