Update getProtocol.md

This commit is contained in:
Angelos Chalaris
2020-10-08 15:24:58 +03:00
committed by GitHub
parent c1738811bc
commit 484bae16af

View File

@ -5,7 +5,7 @@ tags: browser,beginner
Returns the protocol being used on the current page.
- Can be either `http:` or `https:`
- Use `window.location.protocol` to get the protocol (`http:` or `https:`) of the current page.
```js
const getProtocol = () => window.location.protocol;