Files
30-seconds-of-code/snippets/currentURL.md
Angelos Chalaris 97c250bcfb Updated examples
2017-12-27 16:35:25 +02:00

195 B

currentURL

Returns the current URL.

Use window.location.href to get current URL.

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