Files
30-seconds-of-code/snippets/current-URL.md
2017-12-17 11:55:13 +01:00

9 lines
162 B
Markdown

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