Files
30-seconds-of-code/snippets/currentURL.md
Angelos Chalaris 611729214a Snippet format update
To match the starter (for the migration)
2019-08-13 10:29:12 +03:00

233 B

title, tags
title tags
currentURL browser,url,beginner

Returns the current URL.

Use window.location.href to get current URL.

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