Files
30-seconds-of-code/snippets/currentURL.md
Angelos Chalaris 611729214a Snippet format update
To match the starter (for the migration)
2019-08-13 10:29:12 +03:00

16 lines
233 B
Markdown

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