30 seconds of code

  Back to Home

currentURL

browserurlbeginner

Returns the current URL.

Use window.location.href to get current URL.

const currentURL = () => window.location.href;