Files
30-seconds-of-code/snippets/currentURL.md
Isabelle Viktoria Maciohsek 821f442bec Remove url tag
2020-10-18 14:19:29 +03:00

17 lines
241 B
Markdown

---
title: currentURL
tags: browser,beginner
---
Returns the current URL.
- Use `window.location.href` to get the current URL.
```js
const currentURL = () => window.location.href;
```
```js
currentURL(); // 'https://www.google.com/'
```