Get the current URL

PHOTO EMBED

Sun Oct 18 2020 17:01:37 GMT+0000 (Coordinated Universal Time)

Saved by @aymanelya #javascript

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

// Example
currentURL(); // 'https://google.com'
content_copyCOPY

https://blog.madza.dev/24-modern-es6-code-snippets-to-solve-practical-js-problems?guid