Files
30-seconds-of-code/snippets/currentURL.md
銀桑 f64aa9aee0 Hotfix/current url (#1204)
Update currentURL.md

Co-authored-by: Angelos Chalaris <chalarangelo@gmail.com>
2020-09-02 13:48:27 +03:00

17 lines
243 B
Markdown

---
title: currentURL
tags: browser,url,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/'
```