Files
30-seconds-of-code/snippets/currentURL.md
2017-12-28 08:30:19 +00:00

14 lines
196 B
Markdown

### currentURL
Returns the current URL.
Use `window.location.href` to get current URL.
```js
const currentURL = () => window.location.href;
```
```js
currentURL(); // 'https://google.com'
```