Files
30-seconds-of-code/snippets/currentURL.md
2020-03-06 09:57:40 +02:00

238 B

title, tags
title tags
currentURL browser,url,beginner

Returns the current URL.

Use window.location.href to get the current URL.

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